/*
Theme Name: Ó Kerrigan
Theme URI: https://okerrigan.de
Author: Paul Elvey
Author URI: https://okerrigan.de
Description: Custom theme for Ó Kerrigan — heirloom Irish wool clothing. Chapter design v1.
Version: 0.3.0
License: Private
Text Domain: okerrigan
*/

/* ── TOKENS ────────────────────────────────────────────── */
:root {
  --ink:       #1C1C1A;
  --stone:     #E8E2D9;
  --peat:      #6B5F52;
  --fleece:    #F4F1EC;
  --atlantic:  #2C3E35;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --ease-luxe: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.5rem, 5vw, 6rem);
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--atlantic); color: var(--fleece); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── HEADER (markup unchanged in header.php) ───────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 1.75rem var(--pad);
  mix-blend-mode: difference;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #fff;
}

.logo-prefix { font-weight: 600; }

/* ── HERO ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  background-color: var(--stone);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,12,10,0.55), rgba(15,12,10,0.05) 55%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: var(--pad);
  padding-bottom: clamp(4rem, 9vh, 7rem);
}

.hero-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(244,241,236,0.75);
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 7.5vw, 7rem);
  line-height: 1.02;
  color: var(--fleece);
  max-width: 12em;
  text-wrap: balance;
}

.hero-headline em { font-style: italic; }

.hero-sub {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: rgba(244,241,236,0.9);
}

.hero-scrollcue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  width: 1px;
  height: 52px;
  overflow: hidden;
  background: rgba(244,241,236,0.4);
  z-index: 2;
}

.hero-scrollcue::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fleece);
  transform: translateY(-100%);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    opacity: 0;
    transform: translateY(22px);
    animation: hero-in 1.1s var(--ease-luxe) forwards;
  }
  .hero-inner > *:nth-child(2) { animation-delay: 0.15s; }
  .hero-inner > *:nth-child(3) { animation-delay: 0.3s; }
  .hero-scrollcue::after { animation: cue-drop 2.4s var(--ease-luxe) infinite; }
}

@keyframes hero-in { to { opacity: 1; transform: none; } }
@keyframes cue-drop {
  0%   { transform: translateY(-100%); }
  55%, 100% { transform: translateY(100%); }
}

/* ── CHAPTER MARKER ─────────────────────────────────────── */
.chapter-marker {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--peat);
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.chapter-marker::after {
  content: "";
  height: 1px;
  flex: 0 0 3.5rem;
  background: currentColor;
  opacity: 0.45;
}

.chapter-marker b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.1em;
}

/* ── CHAPTER I — Die Entdeckung ─────────────────────────── */
.chapter-one { padding: clamp(7rem, 14vw, 13rem) var(--pad); }

.chapter-one__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  max-width: 1500px;
  margin-inline: auto;
}

.big-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(9rem, 26vw, 26rem);
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.big-num small {
  display: block;
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  font-style: italic;
  color: var(--peat);
  letter-spacing: 0;
  margin-top: 1.5rem;
}

.chapter-one__text {
  padding-top: clamp(1rem, 6vw, 7rem);
  max-width: 34em;
}

.lede {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.35;
  margin-bottom: 2rem;
  text-wrap: balance;
}

.chapter-one__text p + p { margin-top: 1.25rem; }
.chapter-one__text .quiet { color: var(--peat); }
.chapter-one__text em { font-style: italic; color: var(--ink); }

/* ── EDITORIAL BREAK ────────────────────────────────────── */
.editorial-break {
  position: relative;
  height: clamp(24rem, 90vh, 58rem);
  overflow: hidden;
}

.editorial-break img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── CHAPTER II — Der Name ──────────────────────────────── */
.chapter-two {
  background: var(--fleece);
  padding: clamp(7rem, 14vw, 13rem) 0;
  overflow: hidden;
}

.chapter-two__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.chapter-two__text {
  padding-left: var(--pad);
  max-width: 36em;
  justify-self: end;
}

.word {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(3.5rem, 9vw, 8.5rem);
  line-height: 1;
  color: var(--ink);
  margin-bottom: 1rem;
}

.word span { color: var(--peat); }

.word-def {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--peat);
  margin-bottom: 2.5rem;
}

.chapter-two__text p { color: var(--peat); max-width: 32em; }
.chapter-two__text p + p { margin-top: 1.25rem; }
.chapter-two__text p em { font-style: italic; color: var(--ink); }

.chapter-two__img {
  height: clamp(22rem, 70vh, 44rem);
  overflow: hidden;
}

.chapter-two__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
  .js-reveal .chapter-two__img[data-reveal] img {
    transform: scale(1.06);
    transition: transform 1.6s var(--ease-luxe);
  }
  .js-reveal .chapter-two__img[data-reveal].is-visible img {
    transform: scale(1);
  }
}

/* ── CHAPTER III — Die Kollektionen ─────────────────────── */
.chapter-three {
  background: var(--ink);
  color: var(--fleece);
  padding-top: clamp(6rem, 12vw, 11rem);
}

.chapter-three .chapter-marker { color: rgba(244,241,236,0.65); }

.chapter-three__head {
  padding: 0 var(--pad);
  max-width: 1500px;
  margin-inline: auto;
}

.chapter-three__head h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 5.5vw, 5rem);
  line-height: 1.05;
  max-width: 14em;
  text-wrap: balance;
}

.chapter-three__intro {
  margin-top: 1.5rem;
  max-width: 34em;
  color: rgba(244,241,236,0.75);
}

.chapter-three__intro em { font-style: italic; color: var(--fleece); }

.diptych {
  margin-top: clamp(3rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(244,241,236,0.2);
}

.panel {
  position: relative;
  height: clamp(26rem, 92vh, 56rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.75rem, 3vw, 3rem);
  overflow: hidden;
  isolation: isolate;
  color: var(--fleece);
}

.panel--ciar  { background: var(--peat); }
.panel--ciara { background: var(--atlantic); }

/* Optional photography per panel via --tile-img (see index.php) */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--tile-img, none);
  background-size: cover;
  background-position: center;
  transition: transform 1.4s var(--ease-luxe);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.05) 55%);
}

.panel:hover::before,
.panel:focus-visible::before { transform: scale(1.04); }

.panel-label {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.75;
}

.panel-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1;
  margin: 0.5rem 0 0.25rem;
}

.panel-sub { opacity: 0.85; }

.panel-link {
  position: relative;
  width: max-content;
  margin-top: 1.5rem;
  padding-bottom: 0.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.panel-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.6s var(--ease-luxe);
}

.panel:hover .panel-link::after,
.panel:focus-visible .panel-link::after { transform: scaleX(1); }

.panel:focus-visible { outline: 2px solid var(--fleece); outline-offset: -6px; }

/* ── OUTRO ──────────────────────────────────────────────── */
.outro {
  background: var(--ink);
  color: var(--fleece);
  text-align: center;
  padding: clamp(6rem, 13vw, 12rem) var(--pad);
}

.outro p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  line-height: 1.3;
}

.outro em { font-style: italic; color: rgba(244,241,236,0.8); }

/* ── FOOTER (markup unchanged in footer.php) ────────────── */
.site-footer {
  background-color: var(--ink);
  color: var(--fleece);
  border-top: 1px solid rgba(244,241,236,0.12);
  padding: 3.5rem var(--pad) 2.5rem;
  text-align: center;
}

.footer-mark {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2.5rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}

.footer-nav a {
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--stone);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible { opacity: 1; }

.footer-copy {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

/* ── SCROLL REVEAL (works with existing js/reveal.js) ───── */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition:
      opacity 1.1s var(--ease-luxe),
      transform 1.1s var(--ease-luxe);
  }
  .js-reveal [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .chapter-one__grid,
  .chapter-two__grid { grid-template-columns: 1fr; }

  .chapter-one__text { padding-top: 0; }

  .chapter-two__text {
    padding: 0 var(--pad);
    justify-self: start;
  }

  .chapter-two__img { margin-left: var(--pad); }

  .diptych { grid-template-columns: 1fr; }

  .panel { height: 70vh; }
}
