/*
Theme Name: The Site Ruse
Description: Responsive editorial theme for THESITE.BG.
Version: 0.1.5
Requires PHP: 7.4
Text Domain: thesite-ruse
*/

:root {
  color-scheme: light;
  --paper: #f5f9fc;
  --ink: #102c46;
  --muted: #4b6175;
  --line: #d8e5ee;
  --brand: #155182;
  --accent: #019bb8;
  --tint: #c8f2f8;
  --panel: #e8f3fa;
  --display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #00718c; outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 20; left: 12px; top: 10px; padding: 10px; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.shell { max-width: 1376px; margin: auto; padding-inline: clamp(18px, 4.4vw, 70px); }
.page-content { padding-bottom: 36px; }
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead-top { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.identity { display: flex; align-items: center; gap: 27px; }
.brand { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; color: var(--brand); font-size: clamp(26px, 3vw, 42px); font-weight: 950; letter-spacing: -.10em; line-height: 1; }
.brand:hover { text-decoration: none; }
.brand i { align-self: center; width: .28em; height: .28em; border-radius: 50%; background: var(--accent); }
.brand small { font-size: .50em; letter-spacing: -.05em; }
.brand-logo { display: block; width: 78px; height: auto; }
.brand-banner { margin-bottom: 12px; }
.brand-banner img { display: block; width: 100%; height: auto; border-radius: 12px; }
.descriptor { color: var(--muted); font-size: 13px; border-left: 1px solid var(--line); padding-left: 25px; }
.masthead-actions { display: flex; gap: 6px; align-items: center; }
.toplink, .action { min-height: 44px; padding: 0 15px; border: 1px solid #c8dce9; border-radius: 25px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 13px; font-weight: 750; background: #fff; }
.toplink:hover, .action:hover { background: var(--panel); text-decoration: none; }
.menu-toggle { display: none; }
#rubric-nav, #rubric-nav ul { display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; }
#rubric-nav { border-top: 1px solid var(--line); }
#rubric-nav ul { width: 100%; list-style: none; padding: 0; margin: 0; }
#rubric-nav a { min-height: 48px; display: flex; align-items: center; font-size: 14px; font-weight: 680; }
.place { display: flex; align-items: center; gap: 10px; margin: 24px 0 15px; font-size: 12px; font-weight: 700; color: var(--muted); }
.place span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 22px; }
.lead { min-height: 436px; position: relative; isolation: isolate; display: flex; align-items: end; overflow: hidden; border-radius: 19px; color: #fff; background: var(--ink); }
.lead img, .lead::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.lead img { object-fit: cover; object-position: 50% 42%; }
.lead::after { content: ""; background: linear-gradient(180deg, #071d3308 9%, #071d3350 32%, #071d33f2 92%); }
.lead-copy { width: min(100%, 670px); padding: clamp(22px, 4vw, 45px); }
.lead h1 { font: 700 clamp(32px, 4.1vw, 58px)/1.04 var(--display); letter-spacing: -.035em; margin: 12px 0; text-wrap: balance; }
.lead p { max-width: 49ch; font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.tag { display: inline-flex; align-items: center; min-height: 25px; border-radius: 30px; background: var(--tint); color: var(--ink); padding: 4px 10px; font-size: 11px; font-weight: 850; }
.lead time, .card time { font-size: 12px; }
.agenda { padding: clamp(18px, 2.1vw, 28px); background: var(--panel); border: 1px solid var(--line); border-radius: 19px; display: flex; flex-direction: column; }
.agenda h2, .section-head h1, .section-head h2 { font: 700 clamp(27px, 3vw, 40px)/1.1 var(--display); letter-spacing: -.025em; margin: 0; }
.agenda .action { margin-top: auto; align-self: flex-start; }
.events { list-style: none; padding: 0; margin: 15px 0; }
.events li { border-bottom: 1px solid var(--line); }
.events a { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 11px; align-items: center; padding: 12px 0; }
.events a.event-with-image { grid-template-columns: 48px clamp(50px, 8vw, 72px) minmax(0, 1fr); }
.event-image img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.calendar-date { display: grid; min-height: 48px; place-content: center; background: #fff; text-align: center; border-radius: 9px; color: var(--brand); font-size: 13px; font-weight: 750; }
.event-copy small { display: block; color: var(--muted); line-height: 1.35; }
.month-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; scroll-margin-top: 40px; }
.month-calendar { padding: clamp(10px, 2.4vw, 26px); background: #fff; border: 1px solid var(--line); border-radius: 19px; }
.month-toolbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; margin-bottom: 15px; }
.month-toolbar h2 { margin: 0; text-align: center; font: 700 clamp(20px, 3vw, 32px)/1.15 var(--display); }
.month-arrow { padding: 0; font-size: 19px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(2px, .7vw, 7px); }
.month-weekday { padding-bottom: 6px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 750; }
.month-day { min-height: 56px; padding: 5px 2px; display: grid; align-content: start; justify-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-weight: 750; }
.month-day:hover { background: var(--panel); text-decoration: none; }
.month-day-past, .month-day-past:hover { color: #64788a; background: var(--paper); }
.month-day[aria-current="date"] { border-color: var(--accent); }
.month-day.is-selected { color: #fff; background: var(--brand); border-color: var(--brand); }
.month-count { min-width: 17px; padding: 1px 3px; border-radius: 10px; text-align: center; color: var(--ink); background: var(--tint); font-size: 10px; line-height: 1.3; }
.month-today { margin-top: 14px; }
.day-agenda { min-width: 0; }
.day-agenda h2 { font-size: 28px; }
.day-events { list-style: none; padding: 0; margin: 9px 0 0; }
.day-events li + li { border-top: 1px solid var(--line); }
.day-events a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 0; overflow-wrap: anywhere; }
.day-events .event-image { flex: 0 0 56px; }
.day-events small { margin-top: 3px; }
@media (max-width: 820px) {
  .month-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .month-day { min-height: 46px; }
}
.feed { margin-top: 36px; }
.section-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 15px 17px 19px; }
.card .category { font-size: 11px; color: var(--brand); font-weight: 850; text-transform: uppercase; }
.card h3 { font: 700 clamp(20px, 2.1vw, 28px)/1.15 var(--display); margin: 7px 0 10px; }
.card time { color: var(--muted); }
.advert { max-width: 970px; margin: 21px auto 0; }
.ad-frame { aspect-ratio: 8.08; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ad-frame a, .ad-frame img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.ad-frame img { object-fit: contain; }
.ad-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.advert-label { color: var(--muted); font-size: 11px; }
.ad-controls button { width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--brand); background: transparent; }
.ad-controls button:hover { background: var(--panel); }
.article-view { max-width: 1100px; margin: 0 auto; padding-block: clamp(23px, 4vw, 47px) 55px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 13px; margin-bottom: 23px; }
.story-header { max-width: 860px; padding-bottom: 22px; }
.story-header h1 { margin: 13px 0 12px; font: 700 clamp(38px, 5.1vw, 69px)/1.02 var(--display); letter-spacing: -.043em; text-wrap: balance; }
.story-summary { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(17px, 2.1vw, 23px); line-height: 1.55; }
.story-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin-top: 17px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.story-meta-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.story-grid { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 285px); gap: clamp(20px, 4vw, 45px); align-items: start; }
.story-image { margin: 0 0 24px; }
.story-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 17px; }
.type-thesite_event .story-image img { aspect-ratio: auto; max-height: 640px; object-fit: contain; }
.story-image figcaption, .wp-element-caption { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 8px 0 0; }
.story-text { max-width: 70ch; font-size: clamp(17px, 1.65vw, 20px); line-height: 1.72; overflow-wrap: anywhere; }
.story-text p { margin: 0 0 18px; }
.story-text a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.story-text .ad-frame a { text-decoration: none; }
.story-text .wp-block-image { margin-inline: 0; }
.story-text .wp-block-image img, .story-text .wp-block-gallery img { border-radius: 10px; }
.story-text .wp-block-gallery { margin-block: 25px; }
.story-text .gallery { margin-block: 25px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.story-text .gallery-item { margin: 0; }
.story-text .gallery img { border-radius: 10px; }
.event-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; padding: 16px; background: var(--panel); border-left: 3px solid var(--accent); border-radius: 12px; font-size: 15px; }
.event-details dd { margin: 0; font-weight: 650; }
.story-related { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.story-related h2 { font: 700 24px/1.14 var(--display); margin: 0 0 13px; }
.story-related a { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 750; padding: 12px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.story-related a:hover .related-copy { text-decoration: underline; text-underline-offset: 3px; }
.story-related img { flex: 0 0 64px; width: 64px; height: 54px; object-fit: cover; border-radius: 7px; }
.story-related .related-copy { min-width: 0; overflow-wrap: anywhere; }
.story-related time { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
footer { padding-block: 22px; background: #fff; border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; color: var(--muted); font-size: 13px; }
.navigation.pagination { padding-block: 20px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 12px; }

@media (min-width: 731px) and (min-height: 650px) {
  .story-related { position: sticky; top: calc(18px + var(--wp-admin--admin-bar--height, 0px)); }
}

@media (max-width: 730px) {
  .masthead-top { min-height: 65px; gap: 10px; }
  .brand-logo { width: 58px; }
  .brand-banner { margin-bottom: 8px; }
  .brand-banner img { border-radius: 8px; }
  .descriptor { display: none; }
  .menu-toggle { display: inline-flex; }
  .masthead-actions .toplink { padding-inline: 10px; }
  #rubric-nav, #rubric-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
  #rubric-nav ul { grid-column: 1/-1; }
  .js-ready #rubric-nav[data-expanded="false"] { display: none; }
  .lead-grid, .story-grid { grid-template-columns: 1fr; gap: 16px; }
  .lead { min-height: 388px; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card:has(.card-image) { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .card img { height: 100%; min-height: 115px; }
  .card-body { padding: 11px 12px; }
  .story-header h1 { font-size: clamp(33px, 8.8vw, 48px); text-wrap: initial; }
  .story-text { font-size: 18px; line-height: 1.65; }
}
