/* ========== BASE / BRAND ========== */
:root {
  --brand-cream: #f9f7f4;
  --header-h: 64px; /* fixed anchor offset */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Keep vertical scrollbar reserved to avoid layout jiggle */
html {
  scrollbar-gutter: stable right-edge;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

section[id],
#main {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

/* Typography / base */
body {
  font-family: var(--font-body);
  color: #111;
  background-color: var(--brand-cream);
  line-height: 1.6;
}

.font-display,
h1, h2, h3, h4, h5, h6,
.titletop {
  font-family: var(--font-display);
}

.focus-ring:focus-visible {
  outline: 2px solid #eab308;
  outline-offset: 0.5rem;
  border-radius: 0.5rem;
}

/* ========== LAYOUT ========== */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px; /* stabilize header height to prevent page bounce */
}

/* ========== CTA BUTTONS ========== */
button { cursor: pointer; }

.cta-pair a,
.cta-pair button {
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.25rem;
  min-height: 44px;             /* stable row height */
  white-space: nowrap;           /* avoid early wrap jiggle */
}

.cta-primary {
  background-color: #EAB308;
  color: #fff;
  border: 1px solid #EAB308;
}
.cta-primary:hover { background-color: #CA8A04; }

.cta-secondary {
  background-color: #fff;
  color: #A16207;
  border: 1px solid #EAB308;
}
.cta-secondary:hover { background-color: #FEF9C3; }

/* ========== NEWS / SOCIAL ========== */
#insta-card { padding: 0; }

#news,
#news * {
  box-sizing: border-box;
  max-width: 100%;
}

#insta-cap { word-wrap: break-word; overflow-wrap: anywhere; }

/* Social button layout */
#news .social-row {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0.5rem;
  align-items: start;
}
#news .social-meta { min-width: 0; }
#news .social-actions { display: grid; gap: 0.5rem; }
#news .social-actions a { width: 100%; border-radius: 8px; }

@media (min-width: 640px) {
  #news .social-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  #news .social-actions { display: flex; gap: 0.5rem; }
  #news .social-actions a { width: auto; }
}

/* White buttons inside the right-hand news column */
#news-col .cta-secondary {
  color: #374151;               /* gray-700 */
  border-color: #e5e7eb;        /* gray-200 */
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
#news-col .cta-secondary:hover {
  background: #f9fafb;          /* gray-50 */
  border-color: #d1d5db;        /* gray-300 */
}
#news-col ul { border-color: #e5e7eb; }
#news-col li + li { border-top-color: #f0f0f0; }

/* ========== IMAGE HELPERS ========== */
.aspect-square { aspect-ratio: 1 / 1; }

/* Hero image stability */
.book-cover,
img[fetchpriority="high"] {
  display: block;
  height: auto;
}
.book-cover { aspect-ratio: 2 / 3; }

/* ========== CONFIRMATION BANNER ========== */
#confirm-banner { display: none; }
#confirm-banner:not(.hidden) { display: block; }

/* ========== FOOTER ========== */
footer {
  border-top: 1px solid #e5e7eb;
  background: #fff;
  padding: 1.5rem 0;
  font-size: 0.875rem;
  text-align: center;
  color: #4b5563;
}
footer a { text-decoration: underline; }
footer a:hover { text-decoration: none; }

/* ========== ACCESSIBILITY ========== */
/* When the skip link receives focus, reveal it (Tailwind’s sr-only + focus rules) */
.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}

/* ========== TRANSITIONS / SHADOWS (no layout props) ========== */
.transition {
  transition-property: box-shadow, background-color, color, opacity, transform;
  transition-duration: .15s;
  transition-timing-function: cubic-bezier(.4,0,.2,1);
}
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.08); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05); }
.shadow-xl { box-shadow: 0 20px 25px rgba(0,0,0,.1), 0 8px 10px rgba(0,0,0,.1); }
