/* Magazine page - scoped to .page-magazine. Matches the dark luxury
   language of Home / Services / Brands without touching global tokens. */

.page-magazine {
  background:
    radial-gradient(1200px 480px at 50% -10%, rgba(214, 180, 106, 0.1), transparent),
    radial-gradient(900px 420px at 85% 30%, rgba(214, 180, 106, 0.045), transparent),
    linear-gradient(180deg, #060503 0%, #0a0807 40%, #060503 100%);
}

/* Buffer below the translucent sticky topbar so the hero never sits behind it. */
.page-magazine main {
  padding-top: 1.5rem;
}
.page-magazine main > .section:first-child,
.page-magazine main.section {
  padding-top: 5.5rem;
}
@media (max-width: 540px) {
  .page-magazine main {
    padding-top: 1rem;
  }
  .page-magazine main > .section:first-child,
  .page-magazine main.section {
    padding-top: 4rem;
  }
}
.page-magazine html,
html:has(.page-magazine) {
  scroll-padding-top: 90px;
}

/* ---------- Hero ---------- */
.mag-hero {
  position: relative;
  padding: 1.7rem 1.4rem 1.8rem;
  margin-bottom: 1.6rem;
  border: 1px solid rgba(214, 180, 106, 0.32);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(214, 180, 106, 0.13), transparent 70%),
    linear-gradient(180deg, rgba(28, 22, 16, 0.96), rgba(10, 9, 8, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(214, 180, 106, 0.14),
    0 14px 36px rgba(0, 0, 0, 0.4);
  text-align: center;
}
@media (min-width: 720px) {
  .mag-hero {
    padding: 2rem 2rem 2.1rem;
  }
}
.mag-hero h1 {
  margin: 0 0 0.5rem;
  color: var(--champagne);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.25;
}
.mag-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.7;
  max-width: 60ch;
  margin-inline: auto;
}

/* ---------- Filter bar ---------- */
.mag-filterbar {
  margin: 0 0 1.3rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(214, 180, 106, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(20, 16, 12, 0.7), rgba(8, 7, 6, 0.78));
  backdrop-filter: blur(6px);
}
.mag-filterbar-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
@media (min-width: 720px) {
  .mag-filterbar-form {
    grid-template-columns: 1.6fr 1fr;
    align-items: end;
  }
}
.mag-filterbar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--champagne);
  font-size: 0.86rem;
  font-weight: 600;
}
.mag-filterbar input[type="search"],
.mag-filterbar select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(214, 180, 106, 0.32);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.mag-filterbar input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.mag-filterbar input[type="search"]:focus,
.mag-filterbar select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 180, 106, 0.18);
  background: rgba(0, 0, 0, 0.7);
}
.mag-filterbar select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 12px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-left: 2rem;
}

/* ---------- Featured article ---------- */
.mag-featured {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1.6rem;
  padding: 1.3rem 1.2rem 1.4rem;
  border: 1px solid rgba(214, 180, 106, 0.4);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 50% 60% at 30% 0%, rgba(214, 180, 106, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(22, 18, 14, 0.96), rgba(10, 9, 8, 0.97));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}
@media (min-width: 760px) {
  .mag-featured {
    grid-template-columns: 1.05fr 1fr;
    padding: 1.6rem 1.8rem 1.7rem;
    gap: 1.4rem;
  }
}
.mag-featured-tag {
  /* In-flow chip sitting inside the body - no longer overlapping the
     card border. Sits above the meta row with proper spacing. */
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
  background: linear-gradient(180deg, #e8c98a 0%, #c9a763 100%);
  color: #1a1208;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 6px 16px rgba(214, 180, 106, 0.22);
  text-transform: none;
}
.mag-featured-tag::before {
  content: "★";
  font-size: 0.8rem;
  line-height: 1;
}
.mag-featured-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.mag-featured h2 {
  margin: 0;
  color: var(--champagne);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.3;
}
.mag-featured-excerpt {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 56ch;
}
.mag-featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0.15rem 0 0.35rem;
}
.mag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(214, 180, 106, 0.4);
  border-radius: 999px;
  background: rgba(214, 180, 106, 0.08);
  color: var(--champagne);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.mag-pill--muted {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.14);
}
.mag-featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.55rem;
}
.mag-featured-visual {
  display: none;
  border-radius: var(--radius-sm, 12px);
  background-color: #0a0806;
  background-image:
    radial-gradient(ellipse 70% 55% at 30% 0%, rgba(214, 180, 106, 0.22), transparent 65%),
    radial-gradient(ellipse 65% 75% at 80% 100%, rgba(214, 180, 106, 0.12), transparent 70%),
    linear-gradient(135deg, rgba(55, 42, 22, 0.6), rgba(8, 7, 6, 0.85));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(214, 180, 106, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(214, 180, 106, 0.18),
    inset 0 0 60px rgba(214, 180, 106, 0.08);
  position: relative;
  min-height: 240px;
  overflow: hidden;
}
/* When a real article image is loaded, the renderer sets background-image
   to that image. A scrim layer keeps text on the other side legible. */
.mag-featured-visual.has-image {
  background-image: var(--mag-featured-img);
  box-shadow:
    inset 0 0 0 1px rgba(214, 180, 106, 0.18),
    inset 0 0 120px rgba(0, 0, 0, 0.55);
}
.mag-featured-visual.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(270deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 60%);
  pointer-events: none;
}
/* Editorial fallback (no image): minimal gold "✦ Drink House Magazine"
   stamp in the corner - feels like a magazine ornament, not a logo circle. */
.mag-featured-visual:not(.has-image)::before {
  content: "✦ Drink House Magazine";
  position: absolute;
  bottom: 0.95rem;
  inset-inline-start: 1rem;
  font-family: var(--font-primary, inherit);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: rgba(214, 180, 106, 0.7);
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(214, 180, 106, 0.25);
}
.mag-featured-visual:not(.has-image)::after {
  content: "";
  position: absolute;
  top: 0.95rem;
  inset-inline-end: 1rem;
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, rgba(214, 180, 106, 0.6), transparent);
}
@media (min-width: 760px) {
  .mag-featured-visual {
    display: block;
  }
}

/* ---------- Article grid ---------- */
.mag-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.4rem 0 0.85rem;
}
.mag-section-head h2 {
  margin: 0;
  color: var(--champagne);
  font-size: 1.15rem;
}
.mag-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  align-items: start;
  grid-auto-rows: auto;
}
@media (min-width: 600px) {
  .mag-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 980px) {
  .mag-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.mag-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  /* Slightly more vertical padding so cards feel less compressed and
     line up cleanly when excerpts are short. */
  padding: 1.25rem 1.2rem 1.3rem;
  border: 1px solid rgba(214, 180, 106, 0.28);
  border-radius: var(--radius);
  text-align: right;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(214, 180, 106, 0.05), transparent 70%),
    linear-gradient(180deg, rgba(28, 22, 16, 0.92), rgba(12, 10, 8, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(214, 180, 106, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.4);
  min-height: 230px;
  height: auto;
  align-self: start;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.mag-card:hover {
  border-color: rgba(214, 180, 106, 0.55);
  box-shadow:
    0 0 22px rgba(214, 180, 106, 0.16),
    0 14px 30px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}
.mag-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.mag-card h3 {
  margin: 0;
  color: var(--champagne);
  font-size: 1.02rem;
  line-height: 1.35;
}
.mag-card-excerpt {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mag-card-cta {
  margin-top: auto;
  padding-top: 0.65rem;
  display: flex;
  /* Soft gold separator above the CTA so the link always reads as the
     bottom anchor of the card, even when excerpts vary in length. */
  border-top: 1px solid rgba(214, 180, 106, 0.12);
}
.mag-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.mag-card-link::after {
  content: "›";
  font-size: 1.1rem;
  line-height: 1;
}
.mag-card-link:hover {
  color: var(--champagne);
  border-bottom-color: rgba(214, 180, 106, 0.5);
}

/* Skeleton state - visible only while data is loading. */
.mag-skel {
  pointer-events: none;
  border-color: rgba(214, 180, 106, 0.12);
}
.mag-skel-bar {
  height: 0.75rem;
  border-radius: 6px;
  background: rgba(214, 180, 106, 0.06);
  border: 1px solid rgba(214, 180, 106, 0.08);
  position: relative;
  overflow: hidden;
}
.mag-skel-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(214, 180, 106, 0.18), transparent);
  animation: magSkel 1.4s ease-in-out infinite;
}
.mag-skel-bar--lg { height: 1.05rem; width: 70%; }
.mag-skel-bar--md { height: 0.85rem; width: 90%; }
.mag-skel-bar--sm { height: 0.7rem; width: 55%; }
@keyframes magSkel {
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .mag-skel-bar::after { animation: none; }
}

/* ---------- Empty state ---------- */
.mag-empty {
  text-align: center;
  padding: 1.6rem 1rem;
  color: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(214, 180, 106, 0.22);
  border-radius: var(--radius);
  background: rgba(20, 16, 12, 0.55);
}
.mag-empty strong {
  display: block;
  color: var(--champagne);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

/* ---------- FAQ section (mirrors the calculator page FAQ pattern) ----- */
.mag-faq-section {
  margin-top: 1.6rem;
  padding: 0.4rem 0 0.6rem;
}
.mag-faq-section .section-title {
  text-align: center;
  display: block;
  margin: 0 auto 0.55rem;
  position: relative;
  color: var(--champagne);
}
.mag-faq-section .section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 0.5rem auto 0;
  background: linear-gradient(90deg, transparent, rgba(214, 180, 106, 0.6), transparent);
}
.mag-faq-sub {
  margin: 0 auto 1.3rem;
  text-align: center;
  max-width: 56ch;
  color: rgba(245, 234, 210, 0.72);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- Bottom CTA ---------- */
.mag-cta {
  position: relative;
  margin: 2.8rem 0 0.5rem;
  padding: 1.85rem 1.3rem;
  text-align: center;
  border: 1px solid rgba(214, 180, 106, 0.45);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(214, 180, 106, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 70% at 50% 100%, rgba(214, 180, 106, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(22, 18, 12, 0.96), rgba(8, 7, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(214, 180, 106, 0.22),
    0 0 0 1px rgba(214, 180, 106, 0.08),
    0 22px 44px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}
/* Thin gold seam at the top edge - same accent the homepage CTAs carry. */
.mag-cta::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 180, 106, 0.55), transparent);
  pointer-events: none;
}
@media (min-width: 720px) {
  .mag-cta {
    padding: 2.2rem 2rem;
  }
}
.mag-cta h2 {
  margin: 0;
  color: var(--champagne);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  max-width: 32ch;
  line-height: 1.3;
}
.mag-cta p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 56ch;
  line-height: 1.7;
  font-size: 0.98rem;
}
.mag-cta .cta-row {
  justify-content: center;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

/* ---------- Mobile polish ---------- */
@media (max-width: 600px) {
  .mag-hero {
    padding: 1.4rem 1.1rem 1.45rem;
  }
  .mag-featured {
    padding: 1.2rem 1.1rem 1.25rem;
    gap: 0.85rem;
  }
  .mag-featured-tag {
    inset-inline-start: 1rem;
    font-size: 0.72rem;
    padding: 0.28rem 0.7rem;
  }
  .mag-featured-actions .btn {
    width: 100%;
    text-align: center;
  }
  .mag-card {
    padding: 1.1rem 1rem 1.15rem;
  }
  .mag-cta .cta-row {
    width: 100%;
  }
  .mag-cta .cta-row .btn {
    width: 100%;
    text-align: center;
  }
}

/* Belt-and-suspenders: guarantee no horizontal overflow on the page,
   even when long titles or excerpts contain unbreakable strings. */
.page-magazine main,
.page-magazine .container,
.page-magazine .mag-grid,
.page-magazine .mag-card,
.page-magazine .mag-featured {
  min-width: 0;
}
.page-magazine .mag-card h3,
.page-magazine .mag-featured h2 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Pagination (magazine list) ---------- */
.mag-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 1.6rem 0 0;
  direction: rtl;
}
.mag-pagination .mag-page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(214, 180, 106, 0.32);
  border-radius: 10px;
  background: rgba(20, 16, 12, 0.55);
  color: rgba(245, 234, 210, 0.9);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.mag-pagination .mag-page-btn:hover:not(.is-disabled):not(.is-active) {
  border-color: rgba(214, 180, 106, 0.6);
  background: rgba(214, 180, 106, 0.08);
  color: #f5e6c4;
}
.mag-pagination .mag-page-btn.is-active {
  border-color: rgba(214, 180, 106, 0.8);
  background: linear-gradient(180deg, rgba(214, 180, 106, 0.85), rgba(180, 140, 70, 0.85));
  color: #2b1e07;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 14px rgba(214, 180, 106, 0.2);
  cursor: default;
}
.mag-pagination .mag-page-btn.is-disabled,
.mag-pagination .mag-page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.mag-pagination .mag-page-btn:focus-visible {
  outline: 2px solid var(--gold, #d6b46a);
  outline-offset: 2px;
}
