/* =========================================================================
   Content views — News (70y_news) & Results (70y_results)
   list + single + taxonomy. Builds on main.css tokens and the card / .y70-sec
   / .y70-media / .y70-reveal primitives from home-sections.css (enqueued
   alongside this file on content views).
   ========================================================================= */

/* Fallback tokens in case home-sections.css load order changes */
:root{
  --y70-radius: 18px;
  --y70-radius-sm: 12px;
  --y70-shadow: 0 1px 4px rgba(42,44,47,.05);
  --y70-shadow-hover: 0 6px 18px rgba(42,44,47,.10);
  --y70-ring: color-mix(in srgb, var(--primary) 22%, transparent);
}

.y70-main{ min-height: 50vh; }

/* =========================================================================
   Inner-page hero band (archives + singles)
   ========================================================================= */
.y70-page-hero{
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 320px at 88% -30%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 9%, #fff), var(--bg));
  border-bottom: 1px solid var(--border);
  padding: clamp(28px, 5vw, 60px) 0 clamp(24px, 4vw, 44px);
}
.y70-page-hero::before,
.y70-page-hero::after{
  content:""; position:absolute; pointer-events:none; z-index:0;
  background: url(../images/gear_hero.svg) center/contain no-repeat; opacity:.08;
  animation: y70-spin 40s linear infinite;
}
.y70-page-hero::before{ right:-46px; top:-46px; width:200px; height:200px; }
.y70-page-hero::after{ right:120px; top:30px; width:78px; height:78px; opacity:.06; animation-duration:24s; animation-direction:reverse; }
.y70-page-hero > .y70-container{ position:relative; z-index:1; }
.y70-page-hero__eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-size:.82rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--primary-600);
}
.y70-page-hero__eyebrow::before{ content:""; width:26px; height:2px; background:var(--primary-600); border-radius:2px; }
.y70-page-hero__title{
  margin:.45rem 0 0; line-height:1.18; color:var(--dark);
  font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight:800;
}
.y70-page-hero__meta{
  display:flex; align-items:center; gap:10px 16px; flex-wrap:wrap; margin-top:14px;
  color:var(--muted); font-size:.92rem;
}
.y70-page-hero__cats{ display:flex; gap:8px; flex-wrap:wrap; }
.y70-page-hero--single .y70-page-hero__title{ max-width: 22ch; }

/* "back" link */
.y70-back{
  display:inline-flex; align-items:center; gap:8px; font-weight:700; color:var(--primary);
  margin-bottom:14px; transition: gap .2s;
}
.y70-back:hover{ gap:12px; color:var(--primary-600); }

/* =========================================================================
   Archive layout (list pages + native archives)
   ========================================================================= */
.y70-archive{ padding: clamp(28px, 4vw, 52px) 0 clamp(40px, 6vw, 80px); }
.y70-archive-grid{
  display:grid; gap: clamp(16px, 2vw, 24px);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.y70-archive__empty{
  text-align:center; color:var(--muted); padding: 48px 0;
}

/* Uniform grid card (image top + body) — used for both news & results lists */
.y70-gcard{ display:flex; flex-direction:column; }
.y70-gcard__media{ aspect-ratio:16/10; background:#e9ebef; position:relative; }
.y70-gcard__media img{ width:100%; height:100%; object-fit:cover; display:block; }
.y70-gcard__badge{
  position:absolute; left:12px; top:12px; background:var(--primary); color:#fff;
  font-size:.72rem; font-weight:700; padding:5px 10px; border-radius:999px;
}
/* donation-area badge on the result card image (top-left) */
.y70-gcard__area{
  position:absolute; left:12px; top:12px; z-index:2; max-width:calc(100% - 24px);
  background:rgba(255,255,255,.95); color:var(--primary-600); border:1px solid var(--y70-ring);
  font-size:.72rem; font-weight:700; padding:4px 11px; border-radius:999px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  box-shadow:0 2px 6px rgba(42,44,47,.12);
}
.y70-gcard__body{ padding:16px 16px 18px; display:flex; flex-direction:column; gap:10px; flex:1; }
.y70-gcard__title{
  font-size:1.08rem; font-weight:800; color:var(--dark); line-height:1.4; margin:0;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.y70-gcard__excerpt{
  font-size:.92rem; color:#52575f; line-height:1.7; margin:0;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.y70-gcard__foot{ margin-top:auto; display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:6px; }
.y70-gcard__more{ font-weight:700; color:var(--primary); display:inline-flex; align-items:center; gap:6px; font-size:.9rem; }
.y70-card2:hover .y70-gcard__more{ gap:10px; }
.y70-tag{
  display:inline-flex; align-items:center; font-size:.74rem; font-weight:700; color:var(--primary-600);
  background: color-mix(in srgb, var(--primary) 8%, #fff); border:1px solid var(--y70-ring);
  padding:3px 9px; border-radius:999px;
}

/* Pinned/featured news card (wide banner on top of the news list) */
.y70-featured{
  display:grid; grid-template-columns: 1.05fr .95fr; gap:0; overflow:hidden;
  margin-bottom: clamp(22px, 3vw, 34px);
}
.y70-featured__media{ position:relative; min-height:240px; background:#e9ebef; }
.y70-featured__media img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.y70-featured__pin{
  position:absolute; left:14px; top:14px; z-index:2; display:inline-flex; align-items:center; gap:6px;
  background:var(--primary); color:#fff; font-size:.76rem; font-weight:800; padding:6px 12px; border-radius:999px;
  box-shadow: 0 2px 8px rgba(126,0,29,.3);
}
.y70-featured__body{ padding: clamp(20px, 3vw, 36px); display:flex; flex-direction:column; gap:14px; justify-content:center; }
.y70-featured__title{
  margin:0; font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight:800; color:var(--dark); line-height:1.28;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.y70-featured__excerpt{
  margin:0; color:#52575f; line-height:1.8;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.y70-featured__more{ margin-top:6px; align-self:flex-start; }
@media (max-width:760px){
  .y70-featured{ grid-template-columns:1fr; }
  .y70-featured__media{ aspect-ratio:16/9; min-height:0; }
}

/* =========================================================================
   Filter bar (chips)
   ========================================================================= */
.y70-filterbar{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  margin-bottom: clamp(18px, 2.5vw, 28px);
}
.y70-filterbar__label{ font-weight:700; color:var(--muted); font-size:.9rem; margin-right:4px; }
.y70-filter{
  display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:999px;
  border:1px solid var(--border); background:var(--card); color:var(--dark);
  font-weight:700; font-size:.86rem; transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.y70-filter:hover{ border-color:var(--primary-600); transform:translateY(-1px); }
.y70-filter.is-active{ background:var(--primary); color:#fff; border-color:var(--primary); }
.y70-filter__count{ font-size:.76rem; opacity:.75; }

/* =========================================================================
   Pagination
   ========================================================================= */
.y70-pagination{ display:flex; justify-content:center; margin-top: clamp(26px, 4vw, 44px); }
.y70-pagination .page-numbers{
  display:inline-flex; align-items:center; justify-content:center; min-width:42px; height:42px; padding:0 12px;
  border:1px solid var(--border); border-radius:12px; background:var(--card); color:var(--dark);
  font-weight:700; margin:0 4px; transition: background .2s, color .2s, border-color .2s;
}
.y70-pagination .page-numbers:hover{ border-color:var(--primary-600); color:var(--primary); }
.y70-pagination .page-numbers.current{ background:var(--primary); color:#fff; border-color:var(--primary); }
.y70-pagination .page-numbers.dots{ border:0; background:transparent; }

/* =========================================================================
   Single layout
   ========================================================================= */
.y70-single{ padding: clamp(28px, 4vw, 48px) 0 clamp(40px, 6vw, 72px); }
.y70-single__layout{ max-width: 860px; margin:0 auto; }
.y70-single__cover{
  width:100%; aspect-ratio:16/9; object-fit:cover; display:block;
  border-radius: var(--y70-radius); box-shadow: var(--y70-shadow); margin-bottom: clamp(20px, 3vw, 32px);
  background:#e9ebef;
}

/* Gutenberg / rich-text content typography */
.y70-prose{ color:#33373d; font-size:1.05rem; line-height:1.85; }
.y70-prose > *:first-child{ margin-top:0; }
.y70-prose > *:last-child{ margin-bottom:0; }
.y70-prose h2{ font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight:800; color:var(--dark); line-height:1.3; margin:1.8em 0 .6em; }
.y70-prose h3{ font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight:800; color:var(--dark); margin:1.5em 0 .5em; }
.y70-prose h4{ font-size:1.1rem; font-weight:700; color:var(--dark); margin:1.3em 0 .4em; }
.y70-prose p{ margin:0 0 1.1em; }
.y70-prose a{ color:var(--primary); text-decoration:underline; text-underline-offset:2px; }
.y70-prose a:hover{ color:var(--primary-600); }
.y70-prose ul, .y70-prose ol{ margin:0 0 1.2em; padding-left:1.4em; }
.y70-prose li{ margin:.35em 0; }
.y70-prose ul li::marker{ color:var(--primary); }
.y70-prose img,
.y70-prose .wp-block-image img{ max-width:100%; height:auto; border-radius: var(--y70-radius-sm); }
.y70-prose figure{ margin:1.6em 0; }
.y70-prose figcaption{ text-align:center; color:var(--muted); font-size:.86rem; margin-top:8px; }
.y70-prose blockquote{
  margin:1.6em 0; padding:14px 20px; border-left:4px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, #fff); border-radius:0 12px 12px 0; color:#3c4047;
}
.y70-prose blockquote p:last-child{ margin-bottom:0; }
.y70-prose hr{ border:0; border-top:1px solid var(--border); margin:2em 0; }
.y70-prose table{ width:100%; border-collapse:collapse; margin:1.4em 0; font-size:.95rem; }
.y70-prose th, .y70-prose td{ border:1px solid var(--border); padding:10px 12px; text-align:left; }
.y70-prose th{ background: color-mix(in srgb, var(--primary) 7%, #fff); font-weight:700; }
.y70-prose .wp-block-button__link{
  display:inline-block; background:var(--primary); color:#fff; padding:10px 20px; border-radius:12px;
  font-weight:700; text-decoration:none;
}

/* =========================================================================
   Results — Impact panel
   ========================================================================= */
.y70-impact{
  background:var(--card); border:1px solid var(--border); border-radius: var(--y70-radius);
  box-shadow: var(--y70-shadow); padding: clamp(18px, 2.4vw, 26px); margin-bottom: clamp(22px, 3vw, 34px);
}
.y70-impact__head{ display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.y70-impact__head h2{ margin:0; font-size:1.2rem; font-weight:800; color:var(--dark); }
.y70-impact__grid{ display:grid; gap:14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.y70-impact__item{
  position:relative; overflow:hidden; background: var(--bg); border:1px solid var(--border);
  border-radius: var(--y70-radius-sm); padding:16px 18px;
}
.y70-impact__item::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:linear-gradient(var(--primary),var(--primary-600)); }
.y70-impact__num{ font-size:1.55rem; font-weight:900; color:var(--primary); line-height:1.1; }
.y70-impact__label{ margin-top:6px; font-size:.84rem; color:var(--muted); }

/* status badge tones (extend main.css .y70-badge) */
.y70-badge.primary{ background: color-mix(in srgb, var(--primary) 14%, #fff); color:var(--primary-600); border:1px solid var(--y70-ring); }

/* =========================================================================
   Results — Gallery + Lightbox
   ========================================================================= */
.y70-gallery{ margin-bottom: clamp(22px, 3vw, 34px); }
.y70-gallery__main{
  position:relative; width:100%; aspect-ratio:16/10; background:#e9ebef; overflow:hidden;
  border-radius: var(--y70-radius); box-shadow: var(--y70-shadow); cursor: zoom-in;
}
.y70-gallery__main img{ width:100%; height:100%; object-fit:cover; display:block; }
.y70-gallery__zoom{
  position:absolute; right:12px; bottom:12px; background:rgba(42,44,47,.62); color:#fff; border:0;
  width:40px; height:40px; border-radius:50%; cursor:pointer; font-size:18px; display:grid; place-items:center;
}
.y70-gallery__thumbs{ display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; }
.y70-gallery__thumb{
  width:84px; height:64px; border-radius:10px; overflow:hidden; border:2px solid transparent; cursor:pointer;
  background:#e9ebef; padding:0; flex:0 0 auto;
}
.y70-gallery__thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.y70-gallery__thumb.is-active{ border-color:var(--primary); }

.y70-lightbox{
  position:fixed; inset:0; z-index:100000; display:none; place-items:center;
  background:rgba(20,21,23,.92); padding:24px;
}
.y70-lightbox.is-open{ display:grid; }
.y70-lightbox img{ max-width:92vw; max-height:86vh; object-fit:contain; border-radius:8px; }
.y70-lightbox__close,
.y70-lightbox__nav{
  position:absolute; background:rgba(255,255,255,.12); color:#fff; border:0; cursor:pointer;
  width:48px; height:48px; border-radius:50%; font-size:22px; display:grid; place-items:center;
  transition: background .2s;
}
.y70-lightbox__close:hover, .y70-lightbox__nav:hover{ background:rgba(255,255,255,.26); }
.y70-lightbox__close{ top:20px; right:20px; }
.y70-lightbox__nav{ top:50%; transform:translateY(-50%); }
.y70-lightbox__nav--prev{ left:18px; }
.y70-lightbox__nav--next{ right:18px; }

/* =========================================================================
   Related items + Donate CTA band
   ========================================================================= */
.y70-related{ background: linear-gradient(180deg, #fff, var(--bg)); padding: clamp(36px, 5vw, 64px) 0; border-top:1px solid var(--border); }

.y70-cta-band{
  position:relative; overflow:hidden; color:#fff; text-align:center;
  background: linear-gradient(120deg, var(--primary), var(--primary-600));
  padding: clamp(32px, 5vw, 56px) 0;
}
.y70-cta-band::before{
  content:""; position:absolute; right:-40px; top:-40px; width:200px; height:200px; opacity:.12;
  background:url(../images/gear_hero.svg) center/contain no-repeat; animation: y70-spin 40s linear infinite;
}
.y70-cta-band > .y70-container{ position:relative; z-index:1; }
.y70-cta-band__title{ margin:0 0 8px; font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight:800; }
.y70-cta-band__sub{ margin:0 auto 20px; max-width:54ch; opacity:.92; line-height:1.7; }
.y70-cta-band .y70-btn{
  background:#fff; color:var(--primary); border:0; font-weight:800; padding:13px 30px; border-radius:14px;
  display:inline-flex; align-items:center; gap:8px; font-size:1.02rem; transition: transform .2s, box-shadow .2s;
}
.y70-cta-band .y70-btn:hover{ transform:translateY(-2px); box-shadow:0 8px 20px rgba(0,0,0,.18); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 640px){
  .y70-page-hero::after{ display:none; }
  .y70-archive-grid{ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .y70-prose{ font-size:1rem; }
}
@media (prefers-reduced-motion: reduce){
  .y70-page-hero::before, .y70-page-hero::after, .y70-cta-band::before{ animation:none; }
}

/* =========================================================================
   Inner-page site header now lives in main.css (.y70-header--inner): a 2-state
   bar matching the home page (transparent → primary-green on scroll) so it is
   consistent on every page, including those that don't load content.css.
   ========================================================================= */
/* keep the sticky header below the gallery lightbox */
.y70-lightbox{ z-index: 100001; }

/* =========================================================================
   Heading readability polish (hero + sections)
   ========================================================================= */
.y70-page-hero__title{
  color: var(--dark);
  letter-spacing: -0.01em;
  line-height: 1.22;
  text-wrap: balance;
}
/* short brand accent under the hero title for scannability */
.y70-page-hero__title::after{
  content: ""; display: block; width: 54px; height: 4px; margin-top: 16px;
  border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-600));
}
.y70-page-hero__meta{ font-size: .95rem; color: var(--muted); }
.y70-sec__title, .y70-gcard__title, .y70-featured__title{ text-wrap: balance; }

/* =========================================================================
   Search results + 404
   ========================================================================= */
.y70-searchform{ display:flex; gap:10px; max-width:560px; margin:0 0 clamp(20px,3vw,28px); }
.y70-searchform input[type="search"]{
  flex:1; min-width:0; padding:12px 16px; border:1px solid var(--border); border-radius:12px;
  font:inherit; background:var(--card); color:var(--dark);
}
.y70-searchform input[type="search"]:focus{ outline:none; border-color:var(--primary-600); box-shadow:0 0 0 3px var(--y70-ring); }
.y70-searchform .y70-btn{ white-space:nowrap; }
body.error404 .y70-searchform{ margin-left:auto; margin-right:auto; }

.y70-quicklinks{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:18px; }

.y70-searchlist{ display:flex; flex-direction:column; gap:14px; }
.y70-searchitem{ display:flex; align-items:center; gap:16px; padding:18px 20px; }
.y70-searchitem__main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:7px; align-items:flex-start; }
.y70-searchitem__title{ margin:0; font-size:1.1rem; font-weight:800; color:var(--dark); line-height:1.35; }
.y70-searchitem__excerpt{ margin:0; color:#52575f; font-size:.92rem; line-height:1.7;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.y70-searchitem__more{ flex:0 0 auto; color:var(--primary); font-weight:800; font-size:1.3rem; transition:transform .2s; }
.y70-card2:hover .y70-searchitem__more{ transform:translateX(4px); }

/* =========================================================================
   Result attachments (downloadable documents)
   ========================================================================= */
.y70-files{ margin: clamp(24px,3vw,36px) 0 0; }
.y70-files__title{ margin:0 0 14px; font-size:1.2rem; font-weight:800; color:var(--dark); }
.y70-files__list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.y70-file{
  display:flex; align-items:center; gap:14px; padding:14px 16px;
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  text-decoration:none; color:var(--dark);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.y70-file:hover{ border-color:var(--y70-ring); box-shadow:var(--y70-shadow-hover); transform:translateY(-1px); }
.y70-file__ic{ flex:0 0 auto; width:40px; height:40px; display:grid; place-items:center; color:var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, #fff); border-radius:9px; }
.y70-file__ic svg{ width:20px; height:20px; }
.y70-file__info{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.y70-file__name{ font-weight:700; line-height:1.4; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.y70-file__meta{ font-size:.8rem; color:var(--muted); }
.y70-file__dl{ flex:0 0 auto; color:var(--primary); font-weight:800; font-size:1.15rem; }

/* =========================================================================
   Single pages end with the red donate CTA band — let it sit flush against
   the footer (cancel the footer's default 40px top margin, which otherwise
   shows the light page background as a white strip above the dark footer).
   ========================================================================= */
body.single-70y_news .y70-foot,
body.single-70y_results .y70-foot{ margin-top: 0; }

/* =========================================================================
   Event summary box (single news that is an event) — prominent date + place,
   responsive (side-by-side on desktop, stacked on mobile).
   ========================================================================= */
.y70-event{
  background: color-mix(in srgb, var(--primary) 5%, var(--card));
  border:1px solid var(--y70-ring); border-radius: var(--y70-radius);
  padding: clamp(16px, 2.2vw, 24px); margin: 0 0 clamp(22px, 3vw, 32px);
}
.y70-event__head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.y70-event__kicker{ font-size:.8rem; font-weight:800; letter-spacing:.06em; color:var(--primary-600); }
.y70-event__grid{ display:flex; flex-wrap:wrap; gap: clamp(14px, 2.4vw, 28px); }
.y70-event__item{ display:flex; align-items:center; gap:14px; flex:1 1 240px; min-width:0; }
.y70-event__ic{ flex:0 0 auto; width:46px; height:46px; display:grid; place-items:center;
  background:var(--primary); color:#fff; border-radius:12px; }
.y70-event__ic svg{ width:24px; height:24px; }
.y70-event__text{ min-width:0; display:flex; flex-direction:column; gap:3px; }
.y70-event__label{ font-size:.8rem; font-weight:700; color:var(--muted); }
.y70-event__value{ font-size:clamp(1.2rem, 2.2vw, 1.6rem); font-weight:800; color:var(--dark); line-height:1.2; }
.y70-event__value--sm{ font-size:clamp(1rem, 1.5vw, 1.2rem); }
@media (max-width:640px){
  .y70-event__grid{ flex-direction:column; gap:16px; }
  .y70-event__item{ flex-basis:auto; }
}

/* muted badge tone (e.g. event "จัดแล้ว") on content pages */
.y70-badge.muted{ background:var(--bg); color:var(--muted); border:1px solid var(--border); }
