/* ==========================================================================
   NailVelle.com — Editorial Design System & Core Stylesheet
   Brand palette derived from the official NailVelle logo
   ========================================================================== */

:root {
  /* Brand & Editorial Palette */
  --nv-burgundy: #6b0f2a;
  --nv-burgundy-dark: #4c091d;
  --nv-burgundy-soft: #8a2442;
  --nv-rose-gold: #c48e6a;
  --nv-rose-gold-light: #e5c3ab;
  --nv-muted-rose: #a55f6d;
  --nv-blush: #f6ebe7;
  --nv-blush-deep: #eedbd4;
  --nv-ivory: #fbf8f5;
  --nv-white: #ffffff;
  --nv-beige: #e6dad2;
  --nv-beige-subtle: #efe6e0;
  --nv-charcoal: #221d1f;
  --nv-charcoal-soft: #4e4448;
  --nv-muted: #65595d;

  /* Semantic Surfaces & Borders */
  --bg-page: var(--nv-ivory);
  --bg-surface: var(--nv-white);
  --bg-tinted: var(--nv-blush);
  --border-hairline: var(--nv-beige);
  --border-subtle: var(--nv-beige-subtle);

  /* Typography */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Fluid Type Scale (max <= 2.5x min for WCAG 1.4.4 200% zoom compliance) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: clamp(1.125rem, 1.02rem + 0.4vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.15rem + 0.85vw, 1.875rem);
  --text-2xl: clamp(1.75rem, 1.35rem + 1.5vw, 2.625rem);
  --text-3xl: clamp(2.125rem, 1.55rem + 2.2vw, 3.5rem);

  /* Spacing & Layout */
  --container-max: 1260px;
  --container-narrow: 820px;
  --gutter: clamp(1rem, 3vw, 2rem);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;

  /* Radii & Shadows */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 3px rgba(34, 29, 31, 0.04);
  --shadow-sm: 0 6px 20px rgba(34, 29, 31, 0.06);
  --shadow-md: 0 14px 36px rgba(34, 29, 31, 0.09);

  /* Header & Z-Index */
  --header-height: 78px;
  --z-header: 2147483640;
  --z-dropdown: 2147483641;
  --z-drawer: 2147483645;
  --z-toast: 2147483642;

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms var(--ease);
  --t-base: 240ms var(--ease);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--nv-charcoal);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--nv-burgundy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--t-fast), border-color var(--t-fast);
}

a:hover {
  color: var(--nv-burgundy-dark);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--nv-charcoal);
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-3xl);
  line-height: 1.12;
}

h2 {
  font-size: var(--text-2xl);
  line-height: 1.18;
}

h3 {
  font-size: var(--text-xl);
  line-height: 1.25;
}

h4 {
  font-size: var(--text-lg);
}

p {
  margin: 0 0 var(--space-4);
  color: var(--nv-charcoal-soft);
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.35rem;
}

/* Focus Visibility (WCAG 2.2 AA) */
:focus-visible {
  outline: 2px solid var(--nv-burgundy);
  outline-offset: 3px;
  border-radius: 3px;
}

[inert],
[inert] * {
  pointer-events: none;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--nv-burgundy);
  color: var(--nv-white);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--nv-white);
}

/* ==========================================================================
   Layout Primitives
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-8);
}

.section--compact {
  padding-block: var(--space-7);
}

.section--tinted {
  background-color: var(--bg-tinted);
  border-block: 1px solid var(--border-subtle);
}

.section--white {
  background-color: var(--bg-surface);
  border-block: 1px solid var(--border-subtle);
}

.section--deferred {
  content-visibility: auto;
  contain-intrinsic-size: auto 640px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.section-header__copy {
  max-width: 640px;
}

.section-header__copy p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nv-muted-rose);
  margin-bottom: var(--space-2);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--nv-burgundy);
  text-decoration: none;
  border-bottom: 1px solid var(--nv-rose-gold-light);
  padding-bottom: 0.2rem;
}

.section-link:hover {
  border-bottom-color: var(--nv-burgundy);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.btn--primary {
  background-color: var(--nv-burgundy);
  color: var(--nv-white);
}

.btn--primary:hover {
  background-color: var(--nv-burgundy-dark);
  color: var(--nv-white);
}

.btn--secondary {
  background-color: var(--nv-white);
  color: var(--nv-charcoal);
  border-color: var(--border-hairline);
}

.btn--secondary:hover {
  border-color: var(--nv-burgundy);
  color: var(--nv-burgundy);
}

.btn--ghost {
  background-color: transparent;
  color: var(--nv-burgundy);
  border-color: var(--nv-rose-gold-light);
}

.btn--ghost:hover {
  background-color: var(--nv-blush);
  border-color: var(--nv-burgundy);
}

/* ==========================================================================
   Site Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background-color: rgba(251, 248, 245, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
  min-height: var(--header-height);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--nv-charcoal);
  flex-shrink: 0;
}

.brand-link__emblem {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--nv-rose-gold-light);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.brand-link__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-link__name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nv-burgundy);
  letter-spacing: -0.01em;
}

.brand-link__tag {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nv-muted);
  margin-top: 2px;
}

/* Primary Desktop Navigation */
.primary-nav {
  display: flex;
  align-items: center;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav__item {
  position: relative;
  margin: 0;
}

.primary-nav__link,
.primary-nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--nv-charcoal);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background-color var(--t-fast);
}

.primary-nav__link:hover,
.primary-nav__trigger:hover,
.primary-nav__link[aria-current="page"],
.primary-nav__trigger[aria-expanded="true"] {
  color: var(--nv-burgundy);
  background-color: var(--nv-blush);
}

.primary-nav__chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--t-fast);
}

.primary-nav__trigger[aria-expanded="true"] .primary-nav__chevron {
  transform: rotate(180deg);
}

/* Mega Menu */
.mega-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  background: var(--nv-white);
  border-bottom: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-md);
  padding-block: var(--space-6);
  display: none;
}

.mega-menu.is-open {
  display: block;
}

.mega-menu__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
}

.mega-menu__group-title {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nv-muted-rose);
  margin-bottom: var(--space-3);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mega-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu__list li {
  margin-bottom: 0.25rem;
}

.mega-menu__list a {
  display: block;
  padding: 0.3rem 0;
  font-size: var(--text-sm);
  color: var(--nv-charcoal-soft);
  text-decoration: none;
}

.mega-menu__list a:hover {
  color: var(--nv-burgundy);
}

.mega-menu__footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.mega-menu__footer p {
  margin: 0;
  font-size: var(--text-sm);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--nv-white);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.25rem 0.15rem 0.85rem;
  transition: border-color var(--t-fast);
}

.header-search:focus-within {
  border-color: var(--nv-burgundy);
}

.header-search__input {
  width: 170px;
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--nv-charcoal);
  padding: 0.35rem 0;
}

.header-search__input:focus {
  outline: none;
}

.header-search__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--nv-burgundy);
}

.header-search__btn:hover {
  background-color: var(--nv-blush);
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--nv-white);
  color: var(--nv-charcoal);
}

/* Mobile Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-drawer) - 1);
  background: rgba(34, 29, 31, 0.45);
  display: none;
}

.mobile-drawer-backdrop.is-open {
  display: block;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 90vw);
  height: 100dvh;
  z-index: var(--z-drawer);
  background: var(--nv-ivory);
  border-left: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-5);
}

.mobile-drawer.is-open {
  display: flex;
}

.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: var(--space-4);
}

.mobile-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--nv-white);
  color: var(--nv-charcoal);
}

.mobile-drawer__search {
  margin-bottom: var(--space-4);
}

.mobile-drawer__search form {
  display: flex;
  gap: 0.5rem;
}

.mobile-drawer__search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  background: var(--nv-white);
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-list > li {
  border-bottom: 1px solid var(--border-subtle);
  margin: 0;
}

.mobile-nav-list a {
  display: flex;
  align-items: center;
  min-height: 46px;
  font-weight: 500;
  color: var(--nv-charcoal);
  text-decoration: none;
}

.mobile-nav-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.mobile-nav-details summary::-webkit-details-marker {
  display: none;
}

.mobile-nav-details summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--nv-burgundy);
}

.mobile-nav-details[open] summary::after {
  content: "−";
}

.mobile-nav-sublist {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding-left: var(--space-3);
}

.mobile-nav-sublist a {
  min-height: 38px;
  font-size: var(--text-sm);
  color: var(--nv-charcoal-soft);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--nv-ivory) 0%, #f9f2ee 100%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.hero__title {
  margin-bottom: var(--space-4);
}

.hero__lead {
  font-size: var(--text-md);
  max-width: 54ch;
  margin-bottom: var(--space-5);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-hairline);
}

.hero__stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nv-burgundy);
  line-height: 1.1;
}

.hero__stat-label {
  font-size: var(--text-xs);
  color: var(--nv-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero__media {
  position: relative;
}

.hero__frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--nv-blush-deep);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
}

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

.hero__caption {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--nv-muted);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Editorial Cards & Grids
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Category Card */
.category-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--nv-rose-gold-light);
}

.category-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--nv-blush);
}

.category-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms var(--ease);
}

.category-card:hover .category-card__media img {
  transform: scale(1.03);
}

.category-card__body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.category-card__meta {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nv-muted-rose);
  margin-bottom: 0.35rem;
}

.category-card__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--nv-charcoal);
  margin-bottom: 0.45rem;
}

.category-card__desc {
  font-size: var(--text-sm);
  color: var(--nv-charcoal-soft);
  margin-bottom: var(--space-3);
  flex: 1;
}

.category-card__cta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--nv-burgundy);
}

/* Tutorial Card */
.tutorial-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.tutorial-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--nv-rose-gold-light);
}

.tutorial-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--nv-blush);
}

.tutorial-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms var(--ease);
}

.tutorial-card:hover .tutorial-card__media img {
  transform: scale(1.03);
}

.tutorial-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tutorial-card__cat {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nv-muted-rose);
  text-decoration: none;
  margin-bottom: 0.45rem;
}

.tutorial-card__title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.28;
  margin-bottom: 0.6rem;
}

.tutorial-card__title a {
  color: var(--nv-charcoal);
  text-decoration: none;
}

.tutorial-card__title a:hover {
  color: var(--nv-burgundy);
}

.tutorial-card__excerpt {
  font-size: var(--text-sm);
  color: var(--nv-charcoal-soft);
  margin-bottom: var(--space-4);
  flex: 1;
}

.tutorial-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-xs);
  color: var(--nv-muted);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

/* Pill / Subcategory Chips */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.chip-list li {
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--nv-charcoal);
  background: var(--nv-white);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.chip:hover,
.chip.is-active {
  background: var(--nv-burgundy);
  border-color: var(--nv-burgundy);
  color: var(--nv-white);
}

/* Editorial Spotlight Band */
.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.spotlight__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--nv-blush);
}

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

/* ==========================================================================
   Breadcrumbs & Page Hero
   ========================================================================== */

.breadcrumb {
  padding-block: var(--space-4) var(--space-2);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--nv-muted);
}

.breadcrumb__list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.breadcrumb__list li + li::before {
  content: "/";
  color: var(--nv-rose-gold);
}

.breadcrumb__list a {
  color: var(--nv-muted);
  text-decoration: none;
}

.breadcrumb__list a:hover {
  color: var(--nv-burgundy);
  text-decoration: underline;
}

.page-hero {
  padding-block: var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--nv-ivory) 0%, var(--nv-blush) 100%);
}

.page-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-6);
  align-items: center;
}

.page-hero__lead {
  font-size: var(--text-md);
  max-width: 64ch;
}

.page-hero__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm);
}

.page-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Tutorial Article Layout
   ========================================================================== */

.article-header {
  padding-block: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.article-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  font-size: var(--text-sm);
  color: var(--nv-muted);
  margin-top: var(--space-3);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: var(--space-7);
}

.article-main {
  min-width: 0;
}

.article-featured {
  margin: 0 0 var(--space-6);
}

.article-featured__frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-hairline);
  background: var(--nv-blush);
}

.article-featured__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-featured figcaption {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--nv-muted);
}

/* Quick Facts Card */
.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.quick-facts__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nv-muted-rose);
  margin-bottom: 0.25rem;
}

.quick-facts__value {
  font-weight: 600;
  color: var(--nv-charcoal);
  font-size: var(--text-sm);
}

/* Mobile / Inline TOC */
.toc-box {
  background: var(--bg-tinted);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.toc-box__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: var(--space-3);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li {
  margin-bottom: 0.4rem;
}

.toc-list a {
  font-size: var(--text-sm);
  color: var(--nv-charcoal-soft);
  text-decoration: none;
  display: inline-block;
  padding: 0.15rem 0;
}

.toc-list a:hover,
.toc-list a.is-active {
  color: var(--nv-burgundy);
  font-weight: 600;
}

/* Editorial Prose */
.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.prose h3 {
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

.prose p {
  font-size: var(--text-md);
  line-height: 1.78;
}

.prose li {
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--nv-charcoal-soft);
}

/* Step Cards */
.step-list {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0 var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: 0;
}

.step-card__badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nv-burgundy);
  background: var(--nv-blush);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.55rem;
}

.step-card__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step-card p:last-child {
  margin-bottom: 0;
}

/* Callout / Safety Notice */
.callout {
  background: var(--bg-tinted);
  border-left: 3px solid var(--nv-burgundy);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-5);
  margin-block: var(--space-6);
}

.callout__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--nv-burgundy);
  margin-bottom: 0.4rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Native FAQ Accordion (<details name="faq">) */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  color: var(--nv-charcoal);
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.35rem;
  line-height: 1;
  color: var(--nv-burgundy);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item__body {
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
}

.faq-item__body p:last-child {
  margin-bottom: 0;
}

/* Share & Navigation Footer inside Article */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: var(--space-7);
}

.share-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.sidebar-card__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: var(--space-3);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Advertisement Containers (CLS-Safe & Responsive)
   ========================================================================== */

.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-block: var(--space-6);
  padding: var(--space-3);
  background: rgba(239, 230, 224, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  contain: layout style;
}

.ad-slot__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nv-muted);
  margin-bottom: 0.5rem;
}

.ad-slot__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.ad-slot--leaderboard .ad-slot__frame {
  min-height: 90px;
}

.ad-slot--tablet .ad-slot__frame {
  min-height: 60px;
}

.ad-slot--mobile .ad-slot__frame {
  min-height: 50px;
}

.ad-slot--rectangle .ad-slot__frame {
  min-height: 250px;
}

.ad-slot--skyscraper .ad-slot__frame {
  min-height: 600px;
}

.ad-slot--native .ad-slot__frame {
  min-height: 120px;
}

.ad-slot[hidden] {
  display: none !important;
}

/* ==========================================================================
   Search, Filter, Pagination & Legal Pages
   ========================================================================== */

.search-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.search-panel__form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.search-panel__input {
  flex: 1 1 260px;
  min-height: 46px;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  background: var(--nv-ivory);
}

.search-panel__select {
  min-height: 46px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  background: var(--nv-ivory);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-7);
}

.pagination__btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  background: var(--nv-white);
  color: var(--nv-charcoal);
  font-size: var(--text-sm);
  font-weight: 600;
}

.pagination__btn:hover:not(:disabled),
.pagination__btn[aria-current="page"] {
  background: var(--nv-burgundy);
  border-color: var(--nv-burgundy);
  color: var(--nv-white);
}

.pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Contact & Legal Cards */
.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.legal-meta {
  font-size: var(--text-sm);
  color: var(--nv-muted);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: #211a1d;
  color: #e8deda;
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
  margin-top: var(--space-8);
}

.site-footer a {
  color: #e8deda;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--nv-rose-gold-light);
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  padding-bottom: var(--space-7);
  border-bottom: 1px solid rgba(232, 222, 218, 0.14);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: var(--space-4);
}

.footer-brand__emblem {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--nv-rose-gold);
}

.footer-brand__name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--nv-white);
}

.footer-about {
  font-size: var(--text-sm);
  color: #cbbec2;
  max-width: 38ch;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nv-rose-gold-light);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-5);
  font-size: var(--text-xs);
  color: #b7a8ad;
}

.footer-bottom__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.footer-cookie-btn {
  background: transparent;
  border: 1px solid rgba(232, 222, 218, 0.3);
  color: #e8deda;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
}

.footer-cookie-btn:hover {
  border-color: var(--nv-rose-gold-light);
  color: var(--nv-white);
}

/* ==========================================================================
   Back-to-Top & Cookie Preferences (Native <dialog>)
   ========================================================================== */

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--nv-rose-gold-light);
  background: var(--nv-burgundy);
  color: var(--nv-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cookie-banner {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 1rem;
  max-width: 960px;
  margin-inline: auto;
  z-index: var(--z-toast);
  background: var(--nv-white);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__copy {
  flex: 1 1 320px;
  font-size: var(--text-sm);
}

.cookie-banner__copy p {
  margin: 0;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

dialog.cookie-dialog {
  width: min(560px, calc(100vw - 2rem));
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--nv-white);
  color: var(--nv-charcoal);
  box-shadow: var(--shadow-md);
}

dialog.cookie-dialog::backdrop {
  background: rgba(34, 29, 31, 0.55);
  backdrop-filter: blur(2px);
}

.cookie-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.cookie-dialog__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-hairline);
  background: var(--nv-ivory);
  color: var(--nv-charcoal);
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-subtle);
}

.cookie-option__title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.cookie-option__desc {
  font-size: var(--text-sm);
  margin: 0;
}

.cookie-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
