/*
 * Site refresh (PR #39). Loaded after main.css; only overrides.
 * Fonts, spacing, links, cards, header, the home page (Home/page.php) and event pages. Remove this file and its
 * <link> in the layouts to go back.
 */

:root {
  --default-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --heading-font: "Source Serif 4", Georgia, "Times New Roman", serif;
  --nav-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --taca-red: #c8102e;
  --taca-red-dark: #9e0c24;
  --taca-ink: #1d1d1f;
  --taca-muted: #5f6368;
  --taca-line: #e8e8ea;
  --taca-soft: #f6f6f7;
  --radius: 12px;
  --header-accent: var(--taca-red);
  --nav-hover-color: var(--taca-red);
  --nav-dropdown-hover-color: var(--taca-red);
}

body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--taca-ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .title, .section-title h2 {
  font-family: var(--heading-font);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--taca-ink);
}

/* Links look like links in running text. */
main p a, main li a:not(.btn):not(.page-link), .article-content a {
  color: var(--taca-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}
main p a:hover { color: var(--taca-red-dark); }

/* Section titles: quieter underline accent. */
.section-title h2 { font-size: 1.75rem; margin-bottom: .25rem; }
.section-title h2::after, .section-title h2::before { background: var(--taca-red) !important; }

/* Header */
.header { background: #fff; box-shadow: 0 1px 0 var(--taca-line), 0 6px 20px rgba(0,0,0,.04); }
.header .topbar { font-size: 13px; }
.navmenu a, .navmenu a:focus { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 15px; }
.btn-donate {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-left: 1rem; padding: .5rem 1.1rem; border-radius: 999px;
  background: var(--taca-red); color: #fff !important; font-weight: 600; font-size: 15px;
  text-decoration: none; white-space: nowrap;
}
.btn-donate:hover { background: var(--taca-red-dark); }

/* Buttons */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: 0; text-transform: none !important; }
.btn-dark { background: var(--taca-ink); }

/* Cards: news, articles, sidebar widgets */
.services .card, .widget-wrapper {
  border: 1px solid var(--taca-line) !important; border-radius: var(--radius) !important;
  box-shadow: none !important; overflow: hidden; background: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.services .card:hover {
  transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.07) !important;
}
.services .card-img-top { aspect-ratio: 16 / 9; object-fit: contain; background: #fff; width: 100%; }
/* Article and event pages: images keep their own shape; long pasted lines wrap. */
.blog-posts img { max-width: 100%; height: auto; }
/* Event/article main image: posters are often portrait. Show the whole image (the theme
   clipped it at 440px tall), centred and capped so a tall poster doesn't fill the page. */
.blog-posts .post-img { max-height: none; overflow: visible; text-align: center; border-radius: var(--radius); }
.blog-posts .post-img img { display: block; width: auto; max-width: 100%; max-height: 720px; margin: 0 auto; object-fit: contain; }
.blog-posts article .content { overflow-wrap: break-word; }
.services .card .card-body, .services .card-title { font-size: 1rem; }
.widget-wrapper > div:first-child { background: var(--taca-red) !important; }

/* Footer */
.footer { font-size: 15px; }

/* Header fit: never squeeze the logo; tighter menu so the Donate button fits. */
.header .logo { flex-shrink: 0; margin-right: 1.5rem; }
.header .logo img { max-height: 60px; width: auto; }
@media (max-width: 575px) { .header .logo img { max-height: 44px; } }
@media (min-width: 1200px) {
  .navmenu a, .navmenu a:focus { padding-left: 10px !important; padding-right: 10px !important; }
}
@media (max-width: 1199px) {
  .btn-donate { padding: .4rem .8rem; font-size: 14px; margin-left: auto; margin-right: .75rem; }
}

/* Home page sections (Home/_sections.php) */
.home-section { padding: 3.5rem 0; }
.home-section--soft { background: var(--taca-soft); }
.home-title { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 1.5rem; }
.home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.home-head .home-title { margin: 0; }
.home-head a { color: var(--taca-red); font-weight: 600; text-decoration: none; }
.home-note { color: var(--taca-muted); margin: -.75rem 0 1.25rem; }
.event-date {
  flex-shrink: 0; width: 3.5rem; text-align: center; border-radius: 10px; background: var(--taca-red); color: #fff;
  font-size: .8rem; font-weight: 600; text-transform: uppercase; padding: .35rem 0 .45rem; line-height: 1.1;
}
.event-date span { display: block; font-size: 1.5rem; font-family: var(--heading-font); }

.support-band { background: linear-gradient(135deg, var(--taca-red), var(--taca-red-dark)); color: #fff; padding: 3rem 0; }
.support-band .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; flex-wrap: wrap; }
.support-band h2 { color: #fff; margin: 0 0 .4rem; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.support-band p { margin: 0; max-width: 52ch; color: rgba(255,255,255,.9); }
.support-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.support-band .btn-light { color: var(--taca-red); }
.support-band .btn-outline-light:hover { color: var(--taca-red); }

.sponsor-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); align-items: center; }
.sponsor { display: flex; align-items: center; justify-content: center; height: 96px; padding: .75rem; border: 1px solid var(--taca-line); border-radius: var(--radius); background: #fff; }
.sponsor img { max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(.2); }
@media (max-width: 575px) {
  .sponsor-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .sponsor { height: 70px; padding: .45rem; }
}

/* ---- Main story hero + one "News & events" list (Home/_hero.php, Home/_sections.php) ---- */
.brand-strip { background: var(--taca-ink); color: rgba(255,255,255,.75); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: .45rem 0; }
.story-hero { position: relative; overflow: hidden; color: #fff; background: #3a0d16; }
/* The poster itself, blurred and darkened, fills the background; the sharp poster is shown whole on the right. */
.story-hero::before { content: ""; position: absolute; inset: -40px; background: var(--story-image, none) center / cover no-repeat; filter: blur(28px) saturate(1.2); opacity: .55; }
.story-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(40,6,14,.92) 0%, rgba(40,6,14,.78) 45%, rgba(40,6,14,.35) 100%); }
.story-hero--brand { background: linear-gradient(135deg, var(--taca-red), var(--taca-red-dark)); }
.story-hero--brand::before, .story-hero--brand::after { display: none; }
.story-hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2.5rem; align-items: center; padding-top: 3.25rem; padding-bottom: 3.25rem; }
.story-hero--brand .container { grid-template-columns: 1fr; }
.story-label { display: inline-flex; align-items: center; gap: .45rem; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.story-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.12; margin: .6rem 0 .9rem; }
.story-hero p.lead { color: rgba(255,255,255,.9); font-size: 1.1rem; max-width: 52ch; margin: 0; }
.story-hero .actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.story-hero .btn-light { color: var(--taca-red); }
.story-img { display: flex; justify-content: center; }
.story-img img { display: block; max-width: 100%; max-height: 380px; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 18px 40px rgba(0,0,0,.35); background: #fff; }
@media (max-width: 991px) {
  .story-hero .container { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 1.75rem; padding-bottom: 2rem; }
  .story-img img { max-height: 200px; }
  .story-hero p.lead { font-size: 1rem; }
}
.home-note .bi { color: var(--taca-red); margin-right: .25rem; }
.home-note a { color: var(--taca-red); font-weight: 600; }
.stream { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .stream { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stream-item { display: flex; align-items: center; gap: 1rem; padding: .8rem; background: #fff; border: 1px solid var(--taca-line); border-radius: var(--radius); color: var(--taca-ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.stream-item:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.07); color: var(--taca-ink); }
.stream-item > img { width: 128px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--taca-line); border-radius: 8px; flex-shrink: 0; }
.stream-item .event-date { width: 128px; height: 64px; display: flex; flex-direction: column; justify-content: center; }
.stream-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stream-text .meta { display: block; font-size: 13px; color: var(--taca-muted); margin-top: .15rem; }
.stream-text .title { display: block; font-weight: 600; line-height: 1.35; }
.stream-item--event { border-color: rgba(200,16,46,.35); background: #fffafa; }
.event-date--past { background: var(--taca-muted); }
.stream-cta { flex-shrink: 0; font-size: 14px; font-weight: 600; color: #fff; background: var(--taca-red); border-radius: 999px; padding: .35rem .8rem; }
@media (max-width: 575px) { .stream-cta { display: none; } }
@media (max-width: 575px) { .brand-strip { font-size: 10.5px; letter-spacing: .06em; line-height: 1.5; } }

/* Hero from Admin -> Slides: the editor's banner, whole (wide on desktop, portrait on phones) */
.slide-hero { background: var(--taca-ink); padding: 0; }
.slide-hero picture, .slide-hero img { display: block; width: 100%; height: auto; }
.slide-hero img { max-height: 640px; object-fit: contain; margin: 0 auto; background: var(--taca-ink); }
.slide-bar { background: #fff; border-bottom: 1px solid var(--taca-line); }
.slide-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1rem; }
.slide-bar h1 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin: 0; }

/* Quiet-period tiles (no main story): what TACA does all year */
.program-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.program {
  display: flex; flex-direction: column; gap: .4rem; padding: 1.5rem; border: 1px solid var(--taca-line);
  border-radius: var(--radius); background: #fff; color: var(--taca-ink); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.program:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.07); border-color: transparent; color: var(--taca-ink); }
.program-title { font-family: var(--heading-font); font-weight: 600; font-size: 1.2rem; }
.program-text { color: var(--taca-muted); font-size: .97rem; line-height: 1.5; }
.program img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #fff; border-radius: 8px; margin-bottom: .4rem; }

/* Hero: one main button, date/place beside it, secondary actions as text links */
.story-hero .actions { align-items: center; }
.story-where { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .25rem 1rem; color: rgba(255,255,255,.92); font-weight: 500; }
.story-where a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,.45); text-underline-offset: 3px; }
.story-where a:hover { color: #fff; }
.story-links .bi { margin-right: .2rem; }
.story-links { margin: .9rem 0 0; display: flex; gap: 0 1.25rem; flex-wrap: wrap; }
.story-links a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.story-links a:hover { color: rgba(255,255,255,.8); }
.photo-strip { columns: 4 200px; column-gap: .6rem; }
.photo-strip a { display: block; margin-bottom: .6rem; break-inside: avoid; border-radius: 10px; overflow: hidden; }
/* Photos keep their own shape (no cropping): a masonry of whole images. */
.photo-strip img { display: block; width: 100%; height: auto; transition: opacity .2s ease; }
.photo-strip a:hover img { opacity: .9; }
@media (max-width: 575px) { .photo-strip { columns: 2; } }

/* Phones: footer link groups two per row instead of one long column */
@media (max-width: 767px) {
  .footer .footer-links { flex: 0 0 50%; max-width: 50%; }
  .footer .footer-links ul li { padding: 4px 0; }
  .footer .footer-links h4 { margin-bottom: .5rem; }
}
/* Event page: ticket action near the summary */
.event-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.25rem 0 1.5rem; }
.event-cta-link { color: var(--taca-red); font-weight: 600; text-decoration: none; }
#tickets { scroll-margin-top: 110px; }
/* Compact "What we do" (outside quiet periods) */
.home-section--tight { padding: 2.25rem 0; }
.what-row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.what-item { display: flex; align-items: center; gap: .85rem; padding: .6rem; background: #fff; border: 1px solid var(--taca-line); border-radius: var(--radius); color: var(--taca-ink); font-weight: 600; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.what-item:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.07); color: var(--taca-ink); }
.what-item img { width: 72px; height: 54px; object-fit: contain; background: #fff; border-radius: 6px; flex-shrink: 0; }

/* Photo captions (Admin -> Photos caption, else the gallery name) */
.photo-strip a { position: relative; }
.photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem .7rem .55rem; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.6) 60%, rgba(0,0,0,0)); text-shadow: 0 1px 2px #000; line-height: 1.3; }
/* Tighter gap between "Latest news" and the compact "What we do" that follows it */
.home-section:not(.home-section--soft) + .home-section--tight { padding-top: .25rem; }

/* ---- Phones (mobile review of PR #39) ---- */
/* Menu button: a real button, 44px, not touching the logo. */
.mobile-nav-toggle { background: none; border: 0; padding: 0; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 1199px) { .mobile-nav-toggle { margin: 0 .15rem 0 .35rem; } }
/* Narrow phones: logo, Donate and menu always fit (Turkish "Bağış Yap" is the widest). */
@media (max-width: 400px) {
  .header .logo { flex-shrink: 1; min-width: 0; margin-right: .5rem; }
  .header .logo img { max-height: 36px; max-width: 100%; height: auto; }
  .btn-donate { padding: .35rem .65rem; margin-right: 0; }
}
@media (max-width: 575px) {
  /* The logo already says who we are; the strip only pushes the story down. */
  .brand-strip { display: none; }
  /* Admin slide: keep its title and button on the first screen. */
  .slide-hero img { max-height: min(640px, calc(100svh - 300px)); }
  /* Top bar (Member login, language): taller tap targets. */
  .header .topbar a { display: inline-block; padding: 10px 3px; white-space: nowrap; }
  .header .topbar .list-inline { margin-left: .2rem !important; margin-right: .2rem !important; white-space: nowrap; }
  .header .topbar .list-inline-item:not(:last-child) { margin-right: .2rem; }
  /* Four photos are enough on a phone. */
  .photo-strip a:nth-child(n+5) { display: none; }
}
/* Text links that are tapped: at least 44px tall. */
@media (pointer: coarse) {
  .story-links a, .home-head a, .event-cta-link, .story-where a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer .footer-links ul li { padding: 8px 0; }
  .blog-posts .btn-danger, .slide-bar .btn { min-height: 44px; display: inline-flex; align-items: center; }
  .home-note a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer .footer-contact a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  /* Donate: 44px tap area without a taller header. */
  .btn-donate { position: relative; }
  .btn-donate::after { content: ""; position: absolute; inset: -5px -2px; }
}
/* Event page details: readable size, map link. */
.blog-posts .list-inline.fs-7 { font-size: .9375rem; }
.blog-posts .list-inline a { color: inherit; }
@media (max-width: 360px) {
  .stream-item > img, .stream-item .event-date { width: 96px; height: 48px; }
}
/* Long words (200% text, Turkish compounds) wrap instead of running off the screen. */
.story-hero h1, .story-label, .home-title, .stream-text .title { overflow-wrap: break-word; hyphens: auto; }
/* Card titles: three lines at most. */
.stream-text .title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Phones: a plain dark background instead of the blurred poster (blur is costly on cheap phones). */
@media (max-width: 575px) { .story-hero::before { display: none; } }
/* Less motion for people who ask for it. */
@media (prefers-reduced-motion: reduce) {
  .stream-item:hover, .program:hover, .what-item:hover, .services .card:hover { transform: none; }
  html { scroll-behavior: auto !important; }
}
/* Footer phone and email are links now (tap to call / write): keep the footer's text colour. */
.footer .footer-contact a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
/* Very narrow phones: top-bar words without their icons, so they fit on one line. */
@media (max-width: 359px) { .header .topbar .bi { display: none; } }
/* The one-line "no events" note needs little room. */
.home-section--tight .home-note { margin-bottom: 0; }

/* YouTube: thumbnail with a play button until tapped (main.js swaps in the player) */
.yt-lite {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; cursor: pointer;
  border-radius: var(--radius); overflow: hidden; background: #000 center / cover no-repeat;
}
.yt-lite::after {
  content: ""; position: absolute; inset: 50% auto auto 50%; width: 68px; height: 48px; transform: translate(-50%, -50%);
  border-radius: 14px; background: rgba(200,16,46,.92)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.yt-lite:hover::after, .yt-lite:focus-visible::after { background-color: var(--taca-red-dark); }
.ratio > .yt-lite { position: absolute; inset: 0; aspect-ratio: auto; }
