/* =============================================================================
   DEVELOPMENT LOCATION: /opt/data/workspace/projects/city-community-portal/frontend/css/style.css
   DEPLOYED LOCATION:    TBD (planned: Server1 VPS, container TBD)
   JURISDICTION:         TBD (planned: Server1 | Container: TBD)
============================================================================= */
:root {
  --bg: #f7f7f5; --card: #fff; --ink: #1a1a1a; --muted: #8a8a85;
  --accent: #e05545; --line: #ecece8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 15px/1.45 system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo { font-weight: 800; letter-spacing: 1px; } .logo span { color: var(--accent); }
.views { display: flex; gap: 4px; }
.view-btn { border: 0; background: none; padding: 6px 14px; border-radius: 20px; cursor: pointer; color: var(--muted); font-weight: 600; }
.view-btn.active { background: var(--ink); color: #fff; }
.filters { display: flex; gap: 8px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.filters select, .filters input:not([type="checkbox"]), .src-btn { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--card); font-size: 13px; }
.filters input[type="search"] { min-width: 180px; }

/* sources checklist popover */
.srcwrap { position: relative; }
.src-btn { cursor: pointer; }
.src-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 240px; max-height: 320px; overflow-y: auto; padding: 8px; }
.src-pop.hidden { display: none; }
.src-head { font-size: 12px; color: var(--muted); padding: 2px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.src-head a { color: var(--accent); text-decoration: none; font-weight: 600; }
.src-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 13px; cursor: pointer; border-radius: 6px; }
.src-row:hover { background: #f4f3f0; }
.src-row input { accent-color: var(--accent); }
.src-row em { margin-left: auto; color: var(--muted); font-style: normal; font-size: 12px; }

main { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* grid / feed */
#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
@media (max-width: 600px) { #grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 15px; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.card .cats { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 11px; background: #f0efea; border-radius: 20px; padding: 2px 9px; color: #555; }
.tag.free { background: #e6f2e6; color: #2e7d32; } .tag.paid { background: #fdeeea; color: #b34a3a; }
.card .desc { color: #555; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card a.ref { margin-top: auto; font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }

/* calendar */
#calendar .month { margin-bottom: 22px; }
#calendar h2 { font-size: 16px; margin-bottom: 8px; text-transform: capitalize; }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mgrid .dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.day { min-height: 74px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; font-size: 12px; cursor: pointer; }
.day.other { opacity: 0.35; }
.day.past { background: #f0efea; color: #aaa; }
.day.today { background: #fdeceb; border-color: var(--accent); }
.day .num { font-weight: 700; font-size: 12px; }
.day .ev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); padding: 1px 0; }
.day .ev::before { content: "• "; color: var(--accent); font-weight: 700; }
.day .ev.ev-more::before { content: none; }
.day .ev.ev-more { color: var(--muted); font-style: italic; }
.day .ev:first-of-type { margin-top: 3px; }
/* hourly timeline */
.timeline { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; padding: 14px; }
.timeline h3 { margin-bottom: 10px; }
.tl-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); align-items: baseline; cursor: pointer; }
.tl-row .t { color: var(--muted); font-size: 12.5px; text-align: right; }
.tl-row .e { font-size: 13.5px; }

/* clickable cards + detail modal */
.card { cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.card:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.06); }
.card a.ref { cursor: pointer; }
.tl-row:hover .e { color: var(--accent); }

.overlay { position: fixed; inset: 0; background: rgba(20,20,18,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.modal { background: var(--card); border-radius: 16px; max-width: 520px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 22px 24px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal h2 { font-size: 18px; line-height: 1.35; padding-right: 28px; margin-bottom: 10px; }
.mclose { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.mclose:hover { color: var(--ink); }
.mrow { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.mk { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.mv { color: var(--ink); }
.mdesc { margin-top: 12px; font-size: 13.5px; color: #444; }
.mdesc.muted { color: var(--muted); font-style: italic; }
.mref { display: inline-block; margin-top: 14px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; font-size: 13.5px; padding: 9px 16px; border-radius: 10px; }
.mref:hover { opacity: .9; }
