/* =============================================================
   MALTA UNPACKED — styles.css
   Archetype: Magazine Multi-Page (Mediterranean limestone palette)
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f7f3ec;
  --bg-2:      #efe6d7;
  --bg-3:      #e6dbc7;
  --ink:       #17150f;
  --ink-soft:  #3b352c;
  --ink-mute:  #6f675b;
  --accent:    #0e5b73;
  --accent-dk: #094254;
  --ochre:     #b4642a;
  --line:      #17150f;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Fraunces", "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(1.15rem, 4vw, 3.5rem);
  --maxw: 1240px;
  --measure: 68ch;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.06; letter-spacing: -0.015em; font-family: var(--display); font-weight: 600; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--line); opacity: .18; margin: 2.5rem 0; }

/* =============================================================
   3. Utilities
   ============================================================= */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 72ch; margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  border-radius: 6px; font-family: var(--sans); font-size: .9rem;
}
.skip-link:focus { top: 1rem; }
.kicker {
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}
.meta {
  font-family: var(--sans); font-size: .82rem; color: var(--ink-mute);
  letter-spacing: .01em;
}
.rule { height: 1px; background: var(--line); opacity: .2; }
.rule-thick { height: 3px; background: var(--ink); width: 54px; }

/* =============================================================
   4. Typography scale
   ============================================================= */
.t-hero { font-size: clamp(2.5rem, 7.2vw, 5.4rem); font-weight: 600; letter-spacing: -0.03em; }
.t-hero em { font-style: italic; font-weight: 400; color: var(--accent); }
.t-h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); }
.t-h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
.t-h3 { font-size: clamp(1.22rem, 2.2vw, 1.5rem); }
.lede { font-size: clamp(1.1rem, 1.7vw, 1.32rem); line-height: 1.55; color: var(--ink-soft); }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); margin-top: 2.6em; padding-top: .9rem; border-top: 1px solid rgba(23,21,15,.16); }
.prose h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); margin-top: 2em; }
.prose a:not(.aff-btn):not(.card) {
  color: var(--accent-dk);
  border-bottom: 1px solid rgba(14,91,115,.4);
  transition: border-color .3s var(--ease-out), background .3s var(--ease-out);
}
.prose a:not(.aff-btn):not(.card):hover { border-bottom-color: var(--accent); background: rgba(14,91,115,.07); }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 600; }
.dropcap {
  float: left; font-family: var(--display); font-size: 4.05em; line-height: .78;
  padding: .06em .1em 0 0; color: var(--accent); font-weight: 600; font-style: italic;
}

/* Pull quote */
.pullquote {
  margin: 2.6rem 0; padding: 0 0 0 1.6rem;
  border-left: 3px solid var(--ochre);
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.3; color: var(--ink);
}
.pullquote span { display: block; margin-top: .7rem; font: 500 .78rem/1.4 var(--sans); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }

/* =============================================================
   5. Components
   ============================================================= */

/* --- Reading progress bar --- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 200; transition: width .12s linear;
}

/* --- Masthead --- */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,243,236,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(23,21,15,.14);
}
@supports not (backdrop-filter: blur(4px)) { .masthead { background: var(--bg); } }
.masthead-in {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 62px; padding-block: .55rem;
}
.brand { display: flex; align-items: baseline; gap: .5rem; font-family: var(--display); font-size: 1.24rem; font-weight: 600; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; flex: none; align-self: center; }
.brand em { font-style: italic; color: var(--accent); font-weight: 400; }
.nav { display: none; gap: 1.55rem; font-family: var(--sans); font-size: .84rem; font-weight: 500; letter-spacing: .01em; }
.nav a { position: relative; padding-block: .3rem; color: var(--ink-soft); }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; margin-right: -8px; }
.nav-toggle span { display: block; width: 20px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease-out), opacity .2s; }
.nav-toggle span + span { margin-top: 5px; }
.is-menu-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.is-menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.is-menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.mobile-nav {
  display: grid; overflow: hidden; max-height: 0;
  transition: max-height .45s var(--ease-out);
  border-top: 0 solid rgba(23,21,15,.14);
  font-family: var(--sans); font-size: .95rem;
}
.is-menu-open .mobile-nav { max-height: 460px; border-top-width: 1px; }
.mobile-nav a { padding: .85rem var(--gutter); border-bottom: 1px solid rgba(23,21,15,.09); color: var(--ink-soft); }

/* --- Buttons / affiliate CTAs --- */
.btn, .aff-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--sans); font-size: .88rem; font-weight: 600; letter-spacing: .01em;
  padding: .78rem 1.3rem; border-radius: 2px;
  transition: transform .35s var(--ease-out), background .35s var(--ease-out), color .35s var(--ease-out);
}
.aff-btn { background: var(--accent); color: #fff; }
.aff-btn:hover { background: var(--accent-dk); transform: translateY(-2px); }
.aff-btn::after { content: "\2197"; font-size: 1em; line-height: 1; }
.btn-ghost { border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

/* --- Affiliate box --- */
.affbox {
  margin: 2.4rem 0; padding: 1.5rem 1.5rem 1.6rem;
  background: var(--bg-2); border: 1px solid rgba(23,21,15,.14);
  border-left: 3px solid var(--ochre);
}
.affbox h3 { font-size: 1.16rem; margin-bottom: .5rem; }
.affbox p { font-size: .97rem; color: var(--ink-soft); }
.affbox .aff-btn { margin-top: 1.05rem; }
.affbox .fineprint { display: block; margin-top: .85rem; font: 400 .76rem/1.5 var(--sans); color: var(--ink-mute); }

/* --- Disclosure strip --- */
.disclosure {
  font: 400 .78rem/1.5 var(--sans); color: var(--ink-mute);
  padding: .7rem 0; border-block: 1px solid rgba(23,21,15,.12);
  margin-bottom: 2rem;
}
.disclosure a { color: var(--accent-dk); border-bottom: 1px solid rgba(14,91,115,.35); }

/* --- Cards --- */
.cards { display: grid; gap: 1px; background: rgba(23,21,15,.16); border: 1px solid rgba(23,21,15,.16); }
.card {
  display: flex; flex-direction: column; gap: .55rem;
  background: var(--bg); padding: 1.6rem 1.4rem 1.75rem;
  transition: background .4s var(--ease-out);
}
.card:hover { background: var(--bg-2); }
.card-art { margin: -.3rem 0 .55rem; }
.card h3 { font-size: 1.25rem; }
.card p { font-size: .96rem; color: var(--ink-soft); }
.card .meta { margin-top: auto; padding-top: .9rem; }
.card .go { font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--accent); }
.card:hover .go { text-decoration: underline; text-underline-offset: 3px; }

/* --- Table --- */
.table-wrap { overflow-x: auto; margin: 1.8rem 0; border: 1px solid rgba(23,21,15,.16); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 520px; }
th, td { text-align: left; padding: .78rem .95rem; border-bottom: 1px solid rgba(23,21,15,.12); vertical-align: top; }
th { font: 600 .74rem/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; background: var(--bg-2); color: var(--ink-soft); }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-family: var(--sans); font-size: .9rem; }

/* --- Callout --- */
.note {
  margin: 1.8rem 0; padding: 1.05rem 1.2rem;
  background: rgba(14,91,115,.07); border-left: 3px solid var(--accent);
  font-size: .96rem; color: var(--ink-soft);
}
.note strong { color: var(--ink); }

/* --- TOC --- */
.toc { margin: 2rem 0 2.6rem; padding: 1.25rem 1.35rem; border: 1px solid rgba(23,21,15,.16); background: var(--bg-2); }
.toc h2 { font: 600 .74rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); margin: 0 0 .85rem; border: 0; padding: 0; }
.toc ol { margin: 0; padding-left: 1.1rem; font-family: var(--sans); font-size: .92rem; }
.toc li + li { margin-top: .42rem; }
.toc a { color: var(--ink-soft); border-bottom: 1px solid transparent; }
.toc a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* --- FAQ --- */
.faq { border-top: 1px solid rgba(23,21,15,.16); }
.faq details { border-bottom: 1px solid rgba(23,21,15,.16); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.05rem 2rem 1.05rem 0; position: relative;
  font-family: var(--display); font-size: 1.08rem; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .2rem; top: 50%; transform: translateY(-50%);
  font-family: var(--sans); font-size: 1.3rem; color: var(--accent); transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding-bottom: 1.15rem; font-size: .97rem; color: var(--ink-soft); max-width: var(--measure); }

/* --- Figure --- */
figure { margin: 2.2rem 0; }
figure svg, figure img { width: 100%; border: 1px solid rgba(23,21,15,.14); background: var(--bg-2); }
figcaption { margin-top: .6rem; font: italic 400 .85rem/1.5 var(--serif); color: var(--ink-mute); }

/* Photo slot — where the owner drops a real photo */
.photo-slot {
  aspect-ratio: 16 / 9; display: grid; place-items: center; gap: .3rem;
  border: 1px dashed rgba(23,21,15,.3); background: var(--bg-2);
  font: 500 .8rem/1.5 var(--sans); color: var(--ink-mute); text-align: center; padding: 1rem;
}

/* =============================================================
   6. Sections
   ============================================================= */
.hero { padding-block: clamp(2.6rem, 6vw, 5rem) clamp(2rem, 4vw, 3.2rem); }
.hero-grid { display: grid; gap: clamp(1.8rem, 4vw, 3rem); }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; }
.hero-issue {
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center;
  padding-bottom: 1.1rem; margin-bottom: 1.6rem; border-bottom: 2px solid var(--ink);
}

.section { padding-block: clamp(2.6rem, 6vw, 4.6rem); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.9rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.section-alt { background: var(--bg-2); border-block: 1px solid rgba(23,21,15,.14); }

/* Facts strip */
.facts { display: grid; gap: 1px; background: rgba(23,21,15,.16); border: 1px solid rgba(23,21,15,.16); }
.fact { background: var(--bg); padding: 1.25rem 1.2rem; }
.fact dt { font: 600 .7rem/1.3 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-mute); }
.fact dd { margin: .4rem 0 0; font-family: var(--display); font-size: 1.12rem; font-weight: 600; line-height: 1.25; }

/* Article header */
.article-head { padding-block: clamp(2.2rem, 5vw, 3.6rem) 0; }
.breadcrumb { font: 400 .78rem/1.4 var(--sans); color: var(--ink-mute); margin-bottom: 1.1rem; }
.breadcrumb a { border-bottom: 1px solid rgba(23,21,15,.2); }
.byline { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin-top: 1.2rem; }
.byline .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-mute); }

/* Related */
.related { margin-top: 3.4rem; padding-top: 1.6rem; border-top: 2px solid var(--ink); }

/* Footer */
.footer { background: var(--ink); color: var(--bg); padding-block: 3rem 2.2rem; margin-top: clamp(3rem, 7vw, 5.5rem); }
.footer a { color: var(--bg); }
.footer-grid { display: grid; gap: 2.2rem; }
.footer h3 { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: rgba(247,243,236,.55); margin-bottom: .9rem; }
.footer ul { list-style: none; padding: 0; font-family: var(--sans); font-size: .92rem; }
.footer li + li { margin-top: .5rem; }
.footer ul a { color: rgba(247,243,236,.8); transition: color .3s var(--ease-out); }
.footer ul a:hover { color: #fff; }
.footer-bottom {
  margin-top: 2.6rem; padding-top: 1.3rem; border-top: 1px solid rgba(247,243,236,.2);
  font: 400 .8rem/1.6 var(--sans); color: rgba(247,243,236,.55);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* =============================================================
   7. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-revealed { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .09s; }
.reveal-d2 { transition-delay: .18s; }
.reveal-d3 { transition-delay: .27s; }

.parallax { will-change: transform; }

@keyframes seaDrift { from { transform: translateX(0); } to { transform: translateX(-40px); } }
.sea-line { animation: seaDrift 9s var(--ease-soft) infinite alternate; }

@keyframes floatBoat { 0%,100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-6px) rotate(.6deg); } }
.boat { animation: floatBoat 6.5s ease-in-out infinite; transform-origin: center; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  body { font-size: 18px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (min-width: 960px) {
  .nav { display: flex; }
  .nav-toggle, .mobile-nav { display: none; }
  .hero-grid { grid-template-columns: 1.05fr .95fr; align-items: center; }
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
  .aside { position: sticky; top: 92px; font-family: var(--sans); }
  .toc { margin-top: 0; }
}
@media (min-width: 1280px) {
  .card { padding: 1.9rem 1.7rem 2rem; }
}

/* =============================================================
   9. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .sea-line { animation: none; }
  .boat { animation: none; }
  .parallax { transform: none !important; }
}

/* =============================================================
   10. Print
   ============================================================= */
@media print {
  .masthead, .footer, .affbox, .progress, .toc { display: none; }
  body { background: #fff; font-size: 11pt; }
}

/* View transitions */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .45s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Guide band illustration */
.band { margin: 1.9rem 0 0; }
.band .wrap { padding-inline: var(--gutter); }
.band svg {
  width: 100%; height: auto; display: block;
  border: 1px solid rgba(23,21,15,.16);
}
.band .parallax { overflow: hidden; }

/* =============================================================
   11. Photographs
   ============================================================= */
.photo, .band { margin: 0; }
.photo img, .band img {
  width: 100%; height: auto; display: block;
  border: 1px solid rgba(23,21,15,.16);
  background: var(--bg-2);
}
.band-wrap { padding-top: 1.9rem; }
.band figcaption, .photo figcaption {
  margin-top: .55rem; font: italic 400 .84rem/1.5 var(--serif); color: var(--ink-mute);
  max-width: 68ch;
}
.hero-photo img { border-color: rgba(23,21,15,.22); }

/* Home postcards strip */
.postcards { display: grid; gap: 1.4rem; }
@media (min-width: 720px) { .postcards { grid-template-columns: repeat(3, 1fr); } }
.postcards figcaption { font-size: .82rem; }

/* Inline area photo inside prose */
.prose .photo { margin: 1.7rem 0 2rem; }
.prose .photo img { border-color: rgba(23,21,15,.2); }

/* Author portrait */
.portrait { max-width: 320px; margin: 1.9rem 0 2.2rem; }
.portrait img { border-radius: 2px; }
@media (min-width: 720px) {
  .portrait { max-width: 300px; }
}

/* Third-party photo credit inside a caption */
figcaption .credit {
  display: block; margin-top: .3rem;
  font: 400 .74rem/1.5 var(--sans); font-style: normal; color: var(--ink-mute);
}
figcaption .credit a { color: inherit; border-bottom: 1px solid rgba(23,21,15,.25); }
figcaption .credit a:hover { color: var(--accent); }

/* =============================================================
   12. Advertising slots
   ============================================================= */
.ad { display: none; }                 /* hidden until lib/ads.js is configured */
.ad.is-live {
  display: block; margin: 2.6rem 0;
  padding-top: .5rem; border-top: 1px solid rgba(23,21,15,.14);
}
.ad.is-live::before {
  content: attr(data-label);
  display: block; margin-bottom: .5rem;
  font: 500 .66rem/1 var(--sans); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-mute);
}
.ad-inarticle { min-height: 280px; }
.ad-below     { min-height: 280px; }
.ad-home      { min-height: 280px; }
.ad-sidebar   { min-height: 600px; margin-top: 1.6rem; }
.ad ins { display: block; }
@media (max-width: 959px) { .ad-sidebar { display: none !important; } }
@media print { .ad { display: none !important; } }
