/* =========================
   Storybook Theme Tokens
   ========================= */
:root{
  --paper: #e6d2a4;       /* parchment */
  --paper-deep: #d7b56c;  /* deeper parchment */
  --ink: #1a1208;         /* warm dark ink */
  --accent: #7e5321;      /* wood/border accent */
  --shadow: rgba(0,0,0,.28);
}

/* =========================
   Base
   ========================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,.45), transparent 70%),
    var(--paper);
}
h1, h2{
  font-family: "Gill Sans MT Ext Condensed Bold","Gill Sans MT Condensed",
               "League Gothic","Oswald",system-ui,sans-serif;
  letter-spacing: .5px;
  margin: 0 0 .5rem;
}

/* ==== NAVIGATION ==== */
nav {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
}

nav li {
  position: relative;
}

/* ==== NAVIGATION (uniform parchment tabs) ==== */
:root{
  --paper: #e6d2a4;           /* parchment */
  --paper-deep: #d7b56c;      /* deeper parchment */
  --ink: #1a1208;             /* warm dark ink */
  --accent: #7e5321;          /* wood/border accent */
  --shadow: rgba(0,0,0,.28);
}

nav a {
  --biw: 18px;                  /* border width (affects corner scaling) */
  --slice: 128;                  /* inward slice from each edge of PNG */

  display: inline-grid;
  place-items: center;

  height: 75px;                  /* lock height exactly */
  min-width: 170px;
  padding: 0 1rem;

  border: var(--biw) solid transparent;
  border-image-source: url('assets/button.png');
  border-image-slice: var(--slice) fill;
  border-image-width: var(--biw);
  border-image-repeat: stretch;

  background: none;
  color: var(--ink);
  font-family: "Gill Sans MT Ext Condensed Bold","Gill Sans MT Condensed",sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 1px 6px rgba(0,0,0,.25);

  filter: drop-shadow(0 4px 6px rgba(0,0,0,.28));
  transition: transform .2s ease, filter .2s ease;
}

nav a:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.3));
}

nav a:active {
  transform: translateY(0) scale(.98);
}



/* =========================
   Subpage Hero
   ========================= */
.hero.hero--sub{
  height: 32vh; min-height: 220px;
  display: grid; place-items: center; text-align: center;
  color: var(--ink);
  background:
    radial-gradient(60% 80% at 50% 30%, rgba(255,255,255,.45), rgba(255,255,255,.15) 60%, transparent 100%),
    var(--paper-deep);
  border-bottom: 1px solid rgba(126,83,33,.35);
  box-shadow: 0 10px 20px var(--shadow);
}
.hero-text h1{
  font-size: clamp(2rem, 5vw, 3rem);
  text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 2px 6px var(--shadow);
}

/* =========================
   Authors Grid
   ========================= */
.authors-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
  padding: clamp(16px, 3vw, 32px);
  margin: clamp(12px, 2vw, 24px);
  background:
    radial-gradient(50% 100% at 50% 0%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%),
    #fff6de;
  border: 1px solid rgba(126,83,33,.25);
  border-radius: 18px;
  box-shadow: 0 10px 20px var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}

/* =========================
   Flip Cards
   ========================= */
.author-card{
  perspective: 1100px;
  width: 100%;
  max-width: 300px;
  height: 420px;
  margin: auto;
  position: relative;
  transition: max-width .4s ease;
  isolation: isolate;
}
.card-inner{
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .8s ease;
}
.author-card.flipped .card-inner{ transform: rotateY(180deg); }

/* Double width on flip (desktop only) */
@media (min-width: 700px){
  .author-card.flipped{ max-width: 600px; }
}

/* Faces */
.card-front, .card-back{
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border: 1px solid rgba(126,83,33,.35);
  border-radius: 16px;
  box-shadow: 0 6px 14px var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}

/* Front: full-bleed portrait background */
.card-front{
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1rem; text-align: center; color: #fff;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.card-front::after{
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background-image: url(assets/rebecca.png);
  background-position: center;
  background-size: cover;
  z-index: 0;
}
.card-front h2{
  position: relative; z-index: 1; margin: 0;
  font-size: 1.6rem; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.8);
}

/* Back: parchment with bio */
.card-back{
  transform: rotateY(180deg);
  padding: 1.25rem 1.5rem 1.5rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.92)),
    var(--paper);
}
.card-back h2{
  font-size: 1.6rem; color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
  margin: .25rem 0 .5rem;
}
.card-back p{
  font-size: 1rem; line-height: 1.5; color: var(--ink);
  margin: 0 auto; max-width: 52ch; text-align: left;
  hyphens: auto;
}

/* Click to flip (cursor hint if you’re flipping on click) */
.author-card{ cursor: pointer; }

/* =========================
   Author-specific portraits
   (Add one rule per author)
   ========================= */
.author-rebecca .card-front{ background-image: url('assets/author1.jpg'); }
/* .author-john .card-front{ background-image: url('assets/author2.jpg'); } */
/* .author-...  add more as needed */

/* =========================
   Mobile Tweaks
   ========================= */
@media (max-width: 700px){
  nav ul{ gap: .6rem; }
  .author-card{ 
    height: 460px; 
    max-width: 100%; 
    overflow: hidden; /* keep everything inside */
    position: relative; /* for positioning the arrow */
  }
  .author-card.flipped{ max-width: 100%; } /* prevent overflow on phones */

  /* Scrollable bio area */
  .author-card .bio {
    max-height: 240px; /* adjust to fit your design */
    overflow-y: auto;
    padding-right: 8px; /* space for scrollbar */
  }

  /* Little scroll arrow cue */
  .author-card .bio::after {
    content: '▼';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    color: rgba(0,0,0,0.5);
    animation: arrowBounce 1s infinite;
    pointer-events: none; /* don't block scroll */
  }
  @keyframes arrowBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 4px); }
  }
}
