/*
Theme Name: Aspel
Description: Image-led travel theme for Archaeological Sites of the Peloponnese (aspel.gr). Written from scratch: no builders, no jQuery, system fonts, one stylesheet, one small script.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: aspel
*/

/* ---------- tokens ---------- */
:root {
  --stone: #f5efe4;
  --stone-2: #e9dfcb;
  --stone-3: #d6c8ad;
  --ink: #27231c;
  --ink-soft: #5b5446;
  --olive: #5b6730;
  --olive-d: #3b4521;
  --aegean: #0e3d62;
  --aegean-d: #082841;
  --aegean-l: #1c6ea4;
  --terra: #b4582b;
  --gold: #dcb76f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 30, 40, .18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--stone); color: var(--ink);
  font: 400 1.0625rem/1.7 var(--sans); overflow-x: hidden;
}
img, iframe, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--aegean); text-underline-offset: 3px; }
a:hover { color: var(--terra); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.ap-skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; }
.ap-skip:focus { left: 8px; }
.ap-wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.ap-top { background: var(--aegean-d); color: #fff; position: relative; z-index: 20; }
.over-hero .ap-top { position: absolute; inset: 0 0 auto 0; background: linear-gradient(to bottom, rgba(6, 22, 36, .78), rgba(6, 22, 36, 0)); }
.ap-top .ap-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.ap-brand { color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.2rem; font-weight: 700; line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.ap-brand small { display: block; font: 500 .66rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.ap-brand svg { width: 34px; height: 34px; flex: none; }
.ap-burger { background: none; border: 1px solid rgba(255, 255, 255, .5); color: #fff; border-radius: 8px; padding: 8px 12px; font: 600 .85rem var(--sans); cursor: pointer; }
.ap-nav { width: 100%; }
.ap-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ap-menu a { color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 0; display: inline-block; border-bottom: 2px solid transparent; }
.ap-menu a:hover, .ap-menu .current-menu-item a { border-bottom-color: var(--gold); color: #fff; }
.js .ap-nav { display: none; }
.js .ap-nav.is-open { display: block; }
.ap-top .ap-wrap { flex-wrap: wrap; }
.js .ap-top .ap-wrap { padding-bottom: 0; }
.js .ap-nav.is-open { padding-bottom: 14px; }
.ap-top:not(.x) .ap-nav { order: 3; }
.ap-burger { display: none; }
.js .ap-burger { display: inline-block; }
@media (min-width: 860px) {
  .js .ap-burger { display: none; }
  .js .ap-nav, .ap-nav { display: block; width: auto; order: 0; }
  .ap-top .ap-wrap { flex-wrap: nowrap; }
}

/* ---------- credit overlay ---------- */
.ap-frame { position: relative; display: block; overflow: hidden; background: var(--stone-3); }
.ap-credit {
  position: absolute; left: 10px; bottom: 10px; z-index: 3; pointer-events: none;
  background: rgba(8, 20, 32, .72); color: #fff; font: 600 .72rem/1 var(--sans);
  letter-spacing: .02em; padding: 6px 9px; border-radius: 99px; max-width: calc(100% - 20px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- hero (home) ---------- */
.ap-stage { position: relative; min-height: 100svh; min-height: 100vh; color: #fff; display: flex; align-items: flex-end; background: var(--aegean-d); overflow: hidden; }
@supports (min-height: 100svh) { .ap-stage { min-height: 100svh; } }
.ap-slides { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.ap-slide { position: absolute; inset: 0; opacity: 0; animation: ap-fade 28s infinite; }
.ap-slide .ap-frame { position: absolute; inset: 0; background: none; }
.ap-slide:nth-child(2) { animation-delay: 7s; }
.ap-slide:nth-child(3) { animation-delay: 14s; }
.ap-slide:nth-child(4) { animation-delay: 21s; }
.ap-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: ap-drift 28s infinite linear; }
.ap-slide .ap-credit { left: auto; right: 14px; bottom: 14px; }
.ap-slide:first-child { opacity: 1; animation-name: ap-fade-first; }
@keyframes ap-fade-first { 0%, 25% { opacity: 1; } 32%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes ap-fade { 0% { opacity: 0; } 5% { opacity: 1; } 25% { opacity: 1; } 32% { opacity: 0; } 100% { opacity: 0; } }
@keyframes ap-drift { from { transform: scale(1.04); } to { transform: scale(1.14); } }
.ap-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5, 18, 30, .86) 0%, rgba(5, 18, 30, .35) 45%, rgba(5, 18, 30, .25) 100%); }
.ap-stage-copy { position: relative; z-index: 4; padding-bottom: clamp(48px, 10vh, 110px); padding-top: 120px; }
.ap-stage h1 { font-size: clamp(2.3rem, 8.5vw, 5.2rem); margin: 0 0 .25em; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); max-width: 14ch; }
.ap-stage p.lede { font-size: clamp(1.05rem, 2.6vw, 1.4rem); max-width: 40ch; margin: 0 0 1.4em; color: #f1ead9; }
.ap-btn { display: inline-block; background: var(--terra); color: #fff; text-decoration: none; font-weight: 700; padding: 14px 24px; border-radius: 99px; border: 0; cursor: pointer; font-size: 1rem; transition: transform .15s, background .15s; }
.ap-btn:hover { background: #cf6d3b; color: #fff; transform: translateY(-2px); }
.ap-btn.ghost { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .55); backdrop-filter: blur(4px); }
.ap-btn.ghost:hover { background: rgba(255, 255, 255, .26); }
.ap-btn.blue { background: var(--aegean); }
.ap-btn.blue:hover { background: var(--aegean-l); }
.ap-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- intro strip + region chips ---------- */
.ap-intro { padding: clamp(40px, 7vw, 80px) 0 20px; }
.ap-intro .ap-wrap { display: grid; gap: 28px; }
.ap-intro p { font-size: 1.12rem; }
.ap-intro .ap-lead { font-family: var(--serif); font-size: clamp(1.35rem, 3.4vw, 2rem); line-height: 1.35; color: var(--aegean-d); }
.ap-mapthumb { display: block; width: 100%; max-width: 420px; justify-self: end; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 900px) { .ap-intro .ap-wrap { grid-template-columns: 1.4fr 1fr; align-items: start; gap: 56px; } }
.ap-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.ap-chips a { display: inline-block; padding: 8px 16px; border-radius: 99px; background: var(--stone-2); color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none; }
.ap-chips a:hover { background: var(--olive); color: #fff; }

/* ---------- region sections + photo cards ---------- */
.ap-region { padding: clamp(36px, 6vw, 70px) 0 10px; scroll-margin-top: 16px; }
.ap-region h2 { font-size: clamp(1.8rem, 5vw, 2.8rem); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; color: var(--aegean-d); }
.ap-region h2 span { font: 600 .85rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--olive); }
.ap-tiles { display: grid; gap: 18px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 620px) { .ap-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .ap-tiles { grid-template-columns: repeat(3, 1fr); } .ap-tiles li:first-child:nth-last-child(n+4) { grid-column: span 2; } .ap-tiles li:first-child:nth-last-child(n+4) .ap-frame { aspect-ratio: 16/9; } }
.ap-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none; box-shadow: var(--shadow); isolation: isolate; height: 100%; }
.ap-tile .ap-frame { aspect-ratio: 4/3; height: 100%; }
.ap-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ap-tile:hover img { transform: scale(1.06); }
.ap-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5, 18, 30, .88) 0%, rgba(5, 18, 30, .1) 60%); z-index: 1; pointer-events: none; }
.ap-tile-body { position: absolute; left: 0; right: 0; bottom: 38px; padding: 0 18px; z-index: 2; }
.ap-tile-body strong { display: block; font: 700 clamp(1.4rem, 3.4vw, 1.9rem)/1.1 var(--serif); }
.ap-tile-body em { display: block; font: 400 .92rem/1.35 var(--sans); font-style: normal; opacity: .9; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- bands ---------- */
.ap-band { background: var(--aegean-d); color: #f3ecdc; padding: clamp(40px, 7vw, 80px) 0; margin-top: clamp(40px, 6vw, 80px); }
.ap-band h2 { color: #fff; }
.ap-band a { color: var(--gold); }
.ap-band .ap-btn { color: #fff; }

/* ---------- page / site hero ---------- */
.ap-cover { position: relative; color: #fff; min-height: clamp(380px, 68vh, 720px); display: flex; align-items: flex-end; background: var(--aegean-d); overflow: hidden; }
.ap-cover .ap-frame { position: absolute; inset: 0; background: none; }
.ap-cover .ap-frame img { width: 100%; height: 100%; object-fit: cover; }
.ap-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5, 18, 30, .85) 0%, rgba(5, 18, 30, .2) 55%, rgba(5, 18, 30, .35) 100%); }
.ap-cover .ap-credit { left: auto; right: 14px; bottom: 14px; }
.ap-cover-copy { position: relative; z-index: 4; padding-top: 120px; padding-bottom: clamp(52px, 6vw, 64px); width: 100%; }
.ap-cover h1 { font-size: clamp(1.9rem, 6vw, 3.8rem); max-width: 22ch; margin: 0 0 .2em; text-shadow: 0 2px 22px rgba(0, 0, 0, .45); }
.ap-kicker { display: inline-block; font: 700 .85rem var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); text-decoration: none; margin-bottom: 10px; }
.ap-kicker:hover { color: #fff; }
.ap-cover.plain { min-height: 220px; background: linear-gradient(135deg, var(--aegean-d), var(--aegean)); }

/* ---------- article layout ---------- */
.ap-bar { background: var(--olive-d); color: #fff; }
.ap-bar .ap-wrap { display: flex; flex-wrap: wrap; gap: 6px 22px; padding-top: 12px; padding-bottom: 12px; }
.ap-bar a { color: #fff; font-weight: 600; font-size: .92rem; text-decoration: none; padding: 4px 0; }
.ap-bar a:hover { color: var(--gold); }
.ap-article { padding: clamp(32px, 6vw, 72px) 0; }
.ap-article .ap-wrap { display: grid; gap: 36px; }
@media (min-width: 960px) { .ap-article .ap-wrap.has-aside { grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; } }
.ap-prose { max-width: 68ch; min-width: 0; }
.ap-prose > p:first-of-type { font-family: var(--serif); font-size: 1.28rem; line-height: 1.6; color: var(--aegean-d); }
.ap-prose h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 1.6em 0 .5em; color: var(--olive-d); }
.ap-prose h2 .when { display: block; font: 700 .8rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--terra); margin-bottom: 4px; }
.ap-prose .ap-linkline a { font-weight: 700; }
.ap-aside { align-self: start; background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
@media (min-width: 960px) { .ap-aside { position: sticky; top: 20px; } }
.ap-aside h2 { font-size: 1.15rem; margin-bottom: .6em; }
.ap-aside dl { margin: 0 0 1em; }
.ap-aside dt { font: 700 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--olive); }
.ap-aside dd { margin: 0 0 .8em; }
.ap-aside .ap-btn { display: block; text-align: center; margin-bottom: 10px; }
.ap-byline { border-left: 4px solid var(--terra); padding: 6px 0 6px 16px; margin: 0 0 2em; font-size: .98rem; color: var(--ink-soft); }
.ap-byline strong { color: var(--ink); }

/* ---------- gallery ---------- */
.ap-gallery { padding: clamp(32px, 6vw, 72px) 0; background: var(--stone-2); }
.ap-gallery h2, .ap-find h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); color: var(--aegean-d); }
.ap-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 560px) { .ap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .ap-grid { grid-template-columns: repeat(3, 1fr); } .ap-grid li:nth-child(5n+1) { grid-column: span 2; } .ap-grid li:nth-child(5n+1) .ap-frame { aspect-ratio: 3/2; } }
.ap-shot { margin: 0; }
.ap-shot .ap-frame { aspect-ratio: 3/2; border-radius: 10px; }
.ap-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.ap-shot a.ap-zoom { display: block; height: 100%; cursor: zoom-in; }
.ap-shot a:hover img { transform: scale(1.05); }
.ap-shot figcaption { font-size: .9rem; color: var(--ink-soft); padding: 8px 2px 0; min-height: 1.2em; }

/* ---------- map / find ---------- */
.ap-find { padding: clamp(32px, 6vw, 72px) 0; }
.ap-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--stone-3); margin-bottom: 18px; }
.ap-embed iframe { width: 100%; height: clamp(300px, 55vw, 520px); border: 0; }
.ap-embed h3 { margin: 0; padding: 12px 16px; font-size: 1.05rem; background: #fff; }
.ap-ticket { display: grid; gap: 14px; background: var(--olive-d); color: #fff; padding: 28px; border-radius: var(--radius); margin-top: 22px; }
.ap-ticket p { margin: 0; }
@media (min-width: 720px) { .ap-ticket { grid-template-columns: 1fr auto; align-items: center; } }
.ap-more { padding: 10px 0 clamp(32px, 6vw, 72px); }

/* ---------- clickable map ---------- */
.ap-mapbox { position: relative; max-width: 980px; margin: 0 auto 28px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.ap-mapbox img { width: 100%; }
.ap-hot { position: absolute; border-radius: 6px; outline-offset: 0; transition: background .2s; z-index: 2; }
.ap-hot:hover, .ap-hot:focus-visible { background: rgba(220, 183, 111, .45); outline: 2px solid var(--terra); }
.ap-az { columns: 2; column-gap: 24px; list-style: none; padding: 0; margin: 0; }
@media (min-width: 700px) { .ap-az { columns: 3; } }
.ap-az li { break-inside: avoid; margin-bottom: 8px; }
.ap-az a { font-weight: 600; font-size: 1.05rem; }
.ap-az small { display: block; color: var(--ink-soft); font-size: .82rem; }
.ap-az-letter { font: 700 1.3rem var(--serif); color: var(--terra); margin: 18px 0 6px; }

/* ---------- footer ---------- */
.ap-foot { background: var(--aegean-d); color: #d6dde5; padding: 38px 0 30px; margin-top: 0; font-size: .95rem; }
.ap-foot .ap-wrap { display: grid; gap: 14px; }
.ap-foot a { color: #fff; }
.ap-foot strong { color: #fff; }
.ap-foot .ap-fmenu { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 18px; flex-wrap: wrap; }
.ap-credit-line { font-weight: 700; color: #fff; font-size: 1.02rem; }

/* ---------- lightbox ---------- */
dialog.ap-lb { border: 0; padding: 0; background: transparent; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; color: #fff; }
dialog.ap-lb::backdrop { background: rgba(4, 12, 20, .92); }
.ap-lb-in { height: 100%; display: grid; grid-template-rows: 1fr auto; padding: 16px; gap: 10px; }
.ap-lb-in img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.ap-lb-cap { text-align: center; font-size: .95rem; }
.ap-lb button { position: absolute; background: rgba(255, 255, 255, .15); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.ap-lb button:hover { background: rgba(255, 255, 255, .3); }
.ap-lb .x { top: 14px; right: 14px; }
.ap-lb .p { left: 10px; top: 50%; }
.ap-lb .n { right: 10px; top: 50%; }

/* ---------- misc ---------- */
.ap-plain { padding: clamp(32px, 6vw, 72px) 0; }
.ap-note { background: #fff; border-radius: var(--radius); padding: 18px 22px; border-left: 5px solid var(--olive); margin: 0 0 1.6em; }
.ap-404 { text-align: center; padding: 120px 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ap-slide, .ap-slide img { animation: none; }
  .ap-slide:not(:first-child) { display: none; }
  .ap-tile img, .ap-shot img { transition: none; }
}

/* grid children may shrink below their image's intrinsic width */
.ap-tiles > li, .ap-grid > li, .ap-az > li, .ap-intro .ap-wrap > *, .ap-article .ap-wrap > * { min-width: 0; }
@media (max-width: 479px) { .ap-brand small { display: none; } .ap-brand { font-size: 1.35rem; } }
