:root {
  --brand-dark: #1E5435;
  --brand: #2D7A4F;
  --brand-light: #85C995;
  --ink: #4A5568;
  --paper: #F5F5F5;
  --cream: #FAF8F3;
  --brass: #C9A961;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-serif {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

.magazine-divider {
  height: 2px;
  background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.5) 20%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0.5) 80%, transparent 100%);
  position: relative;
}
.magazine-divider::before,
.magazine-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.8);
  transform: translateY(-50%) rotate(45deg);
}
.magazine-divider::before { left: 0; }
.magazine-divider::after { right: 0; }

/* ---------------------------------------------------------------------------
   Scroll reveals.
   Hidden state is scoped to .js so that if the script fails to load the copy
   still renders. Without this guard a missing main.js leaves the page blank.
   --------------------------------------------------------------------------- */
.js .fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.js .fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.js .fade-in { opacity: 0; transition: opacity 1s ease; }
.js .fade-in.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade-in-up,
  .js .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cover-frame { transition: none !important; }
  .animate-bounce { animation: none !important; }
}

/* --------------------------------------------------------------------------
   Background textures
   -------------------------------------------------------------------------- */
.hero-dot-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232D7A4F' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.green-dot-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FFFFFF' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.diagonal-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23FFFFFF' fill-opacity='1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   The magazine cover
   Rendered as a physical object: paper stock, a spine, and layered shadows.
   Swap the placeholder for <img class="cover-art"> once the print PDF lands —
   the frame, spine and shadows all still apply.
   -------------------------------------------------------------------------- */
.cover-frame {
  position: relative;
  aspect-ratio: 8.5 / 11;
  border-radius: 2px 5px 5px 2px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 100%);
  box-shadow:
    0 1px 1px rgba(30,84,53,0.10),
    0 4px 8px rgba(30,84,53,0.10),
    0 12px 24px rgba(30,84,53,0.14),
    0 28px 56px rgba(30,84,53,0.18);
  transform: perspective(1600px) rotateY(-7deg) rotateX(1deg);
  transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) {
  .cover-frame:hover {
    transform: perspective(1600px) rotateY(-2deg) rotateX(0deg) translateY(-6px);
    box-shadow:
      0 2px 2px rgba(30,84,53,0.10),
      0 8px 16px rgba(30,84,53,0.12),
      0 20px 40px rgba(30,84,53,0.16),
      0 40px 80px rgba(30,84,53,0.22);
  }
}

/* Spine: a darker gutter down the bound edge */
.cover-frame::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 14px;
  background: linear-gradient(to right,
    rgba(0,0,0,0.28) 0%,
    rgba(0,0,0,0.10) 45%,
    rgba(255,255,255,0.10) 75%,
    rgba(255,255,255,0.02) 100%);
  z-index: 3;
  pointer-events: none;
}

/* Sheen: a soft diagonal highlight so it reads as coated stock */
.cover-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    rgba(255,255,255,0.16) 0%,
    rgba(255,255,255,0.04) 30%,
    rgba(255,255,255,0) 55%);
  z-index: 4;
  pointer-events: none;
}

.cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12% 10% 10%;
}

.cover-rule {
  width: 54px;
  height: 1px;
  background: rgba(201,169,97,0.85);
}

/* --------------------------------------------------------------------------
   Directory
   -------------------------------------------------------------------------- */
.biz-card {
  transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease;
}
.biz-card:hover {
  box-shadow: 0 10px 25px rgba(30,84,53,0.12);
  border-color: rgba(45,122,79,0.35);
  transform: translateY(-2px);
}

.biz-card[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Digital edition reader (/issue)
   A dark reading surface so the printed pages carry the colour, with fixed
   chrome top and bottom and the page filling everything between.
   -------------------------------------------------------------------------- */
.reader-body {
  background: #12261B;
  color: #E8F0EA;
  margin: 0;
  overscroll-behavior: none;
}
.reader-body.reader-locked { overflow: hidden; }

.reader-shell {
  display: flex;
  flex-direction: column;
  height: 100svh;
}

.reader-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(9, 26, 18, 0.92);
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
  z-index: 2;
}
.reader-bar--top {
  justify-content: space-between;
  border-bottom: 1px solid rgba(133, 201, 149, 0.16);
  padding-top: max(10px, env(safe-area-inset-top));
}
.reader-bar--bottom {
  justify-content: center;
  border-top: 1px solid rgba(133, 201, 149, 0.16);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.reader-home {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.reader-home img { flex: 0 0 auto; width: 32px; height: 32px; object-fit: contain; }
.reader-home-text { display: flex; flex-direction: column; min-width: 0; }
.reader-home-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
}
.reader-home-name em { color: #85C995; font-style: italic; }
.reader-home-sub {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232, 240, 234, 0.6);
  margin-top: 2px;
}

.reader-actions { display: flex; align-items: center; gap: 8px; }

.reader-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: #E8F0EA;
  background: rgba(133, 201, 149, 0.12);
  border: 1px solid rgba(133, 201, 149, 0.28);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.reader-btn:hover { background: rgba(133, 201, 149, 0.22); border-color: rgba(133, 201, 149, 0.5); }
.reader-btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.reader-btn[aria-pressed="true"] { background: #2D7A4F; border-color: #2D7A4F; }

.reader-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #E8F0EA;
  background: rgba(133, 201, 149, 0.12);
  border: 1px solid rgba(133, 201, 149, 0.28);
  cursor: pointer;
  transition: background .2s ease, opacity .2s ease;
  flex: 0 0 auto;
}
.reader-nav svg { width: 20px; height: 20px; }
.reader-nav:hover:not(:disabled) { background: rgba(133, 201, 149, 0.24); }
.reader-nav:disabled { opacity: 0.3; cursor: default; }

.reader-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}
.reader-meta-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.reader-meta-count {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(232, 240, 234, 0.55);
  margin-top: 2px;
}

/* The page itself ---------------------------------------------------------- */
.reader-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.reader-page {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  background: #fff;
  cursor: zoom-in;
}

/* Zoomed: drop the fit constraint and let the stage scroll. This is what
   makes the wide cross-gutter spreads legible on a phone. */
.reader-stage.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.reader-stage.is-zoomed .reader-page {
  max-width: none;
  max-height: none;
  width: auto;
  cursor: zoom-out;
}

/* Contents overlay --------------------------------------------------------- */
.reader-grid-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(9, 26, 18, 0.97);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
}
.reader-grid-panel[hidden] { display: none; }

.reader-grid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  border-bottom: 1px solid rgba(133, 201, 149, 0.16);
}
.reader-grid-head h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.reader-grid-items {
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  padding: 20px 16px max(20px, env(safe-area-inset-bottom));
}

.reader-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(232, 240, 234, 0.7);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.reader-thumb img {
  width: 100%;
  height: auto;
  border: 2px solid transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  background: #fff;
  transition: border-color .2s ease, transform .2s ease;
}
.reader-thumb:hover img { transform: translateY(-2px); border-color: rgba(133, 201, 149, 0.5); }
.reader-thumb[aria-current="true"] img { border-color: #85C995; }
.reader-thumb[aria-current="true"] { color: #85C995; }

.reader-noscript {
  max-width: 40rem;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}
.reader-noscript a { color: #85C995; }

/* Narrow phones: the wordmark, the edition line and two labelled buttons do
   not co-exist in 390px. Drop the edition line and reduce the buttons to
   their icons rather than letting anything wrap into anything else. */
@media (max-width: 540px) {
  .reader-home-sub { display: none; }
  .reader-home-name { font-size: 14px; }
  .reader-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .reader-btn { padding: 10px; gap: 0; }
  .reader-btn--zoom { padding: 9px 13px; }
  .reader-stage { padding: 10px; }
  .reader-bar--bottom { gap: 10px; }
  .reader-meta { min-width: 0; }
}

@media (min-width: 1024px) {
  .reader-bar { padding: 12px 24px; }
  .reader-stage { padding: 24px; }
  .reader-bar--bottom { gap: 20px; }
}

/* Keyboard focus needs to stay visible now that outlines are suppressed on
   several controls by the utility classes. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
