/* ==========================================================================
   C.P.M.A.M. — Heritage Granata Watercolor & Stipple Design System
   Matches the user's watercolor & stipple mockup aesthetic across all pages.
   ========================================================================== */

:root {
  --paper-base: #f5ece0;
  --paper-light: #fcf8f1;
  --paper-card: rgba(255, 251, 244, 0.92);
  --paper-border: rgba(164, 128, 92, 0.35);

  --granata: #681828;
  --granata-deep: #480e1a;
  --granata-soft: #8a283b;
  --granata-wash: rgba(122, 34, 52, 0.14);

  --ochre: #c69644;
  --ochre-deep: #9c6f27;
  --ochre-light: #e5c47f;
  --ochre-wash: rgba(206, 162, 84, 0.25);

  --river-blue: #466c80;
  --river-wash: rgba(70, 108, 128, 0.14);

  --ink-dark: #281915;
  --ink-body: #44312b;
  --ink-muted: #766057;

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --shadow-card: 0 10px 28px -8px rgba(56, 34, 24, 0.14), 0 2px 6px rgba(56, 34, 24, 0.06);
  --shadow-lift: 0 16px 36px -10px rgba(72, 14, 26, 0.22);
  --radius-card: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink-body);
  background-color: var(--paper-base);
  /* Layered warm tea/watercolor washes on cotton paper */
  background-image:
    radial-gradient(ellipse 60% 45% at 6% 12%, rgba(214, 174, 118, 0.24) 0%, transparent 70%),
    radial-gradient(ellipse 55% 40% at 94% 18%, rgba(205, 162, 106, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 65% 50% at 10% 88%, rgba(196, 150, 96, 0.28) 0%, transparent 72%),
    radial-gradient(ellipse 55% 45% at 92% 85%, rgba(162, 118, 78, 0.20) 0%, transparent 72%),
    linear-gradient(180deg, #f8f1e6 0%, #f3e8d8 55%, #efe1cc 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

/* Subtle organic stipple & paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.38;
  background-image:
    radial-gradient(rgba(82, 54, 38, 0.14) 0.75px, transparent 0.75px),
    radial-gradient(rgba(120, 82, 54, 0.09) 0.65px, transparent 0.65px);
  background-size: 16px 16px, 23px 23px;
  background-position: 0 0, 7px 11px;
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* SVG Filter helpers (hidden in HTML) */
.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 28px);
}

/* ==========================================================================
   HEADER & WATERCOLOR NAVBAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(251, 246, 238, 0.97) 0%, rgba(245, 235, 220, 0.95) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(186, 144, 78, 0.55);
  box-shadow: 0 4px 18px rgba(62, 38, 26, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  position: relative;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink-dark);
  position: relative;
  z-index: 60;
  flex-shrink: 0;
}

.brand-logo-wrap {
  width: 74px;
  height: 74px;
  margin-bottom: -14px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 5px 10px rgba(45, 20, 15, 0.24));
  transition: transform 0.25s ease;
}

.brand-link:hover .brand-logo-wrap {
  transform: scale(1.04);
}

.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.08;
}

.brand-acronym {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: 0.03em;
  color: var(--ink-dark);
}

.brand-sub {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

/* Primary Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.nav-btn {
  position: relative;
  border: none;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 0.89rem;
  font-weight: 500;
  color: var(--ink-dark);
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  z-index: 1;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 2px 2px;
  z-index: -1;
  border-radius: 16px 22px 15px 20px / 14px 18px 15px 17px;
  background: transparent;
  transition: background 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}

.nav-btn:hover::before {
  background: radial-gradient(ellipse at center, rgba(214, 173, 98, 0.34) 0%, rgba(214, 173, 98, 0.16) 75%, transparent 100%);
  opacity: 1;
}

.nav-btn.active {
  color: var(--granata-deep);
  font-weight: 700;
}

.nav-btn.active::before {
  background:
    radial-gradient(ellipse at 30% 45%, rgba(232, 194, 124, 0.72) 0%, transparent 68%),
    radial-gradient(ellipse at 72% 55%, rgba(210, 162, 86, 0.56) 0%, transparent 72%),
    linear-gradient(135deg, rgba(226, 186, 114, 0.52), rgba(206, 158, 80, 0.36));
  box-shadow: 0 2px 10px rgba(186, 140, 68, 0.22);
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid var(--granata);
  color: var(--granata);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ==========================================================================
   WATERCOLOR BRUSH BUTTONS & PILLS (Core Signature Aesthetic)
   ========================================================================== */
.btn-wc {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  text-decoration: none;
  z-index: 1;
  transition: transform 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}

.btn-wc::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 22px 15px 20px 16px / 14px 20px 15px 19px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-wc:hover {
  transform: translateY(-2px);
}

.btn-wc:active {
  transform: translateY(0);
}

/* Granata brush button */
.btn-wc-granata {
  color: #fdf7ec;
  text-shadow: 0 1px 2px rgba(28, 6, 10, 0.5);
}

.btn-wc-granata::before {
  background:
    radial-gradient(ellipse at 25% 30%, rgba(154, 42, 64, 0.92) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 70%, rgba(72, 14, 26, 0.96) 0%, transparent 65%),
    linear-gradient(135deg, #741c2f 0%, #581221 52%, #440c18 100%);
  box-shadow: 0 4px 14px rgba(84, 16, 30, 0.35), inset 0 0 8px rgba(38, 6, 12, 0.45);
  border: 1px solid rgba(220, 180, 120, 0.35);
}

.btn-wc-granata:hover::before {
  background:
    radial-gradient(ellipse at 30% 30%, rgba(174, 52, 74, 0.95) 0%, transparent 60%),
    linear-gradient(135deg, #822237 0%, #641627 55%, #4d0f1d 100%);
}

/* Ochre / Antique Gold brush button */
.btn-wc-ochre {
  color: #fffbf2;
  text-shadow: 0 1px 2px rgba(68, 44, 12, 0.48);
}

.btn-wc-ochre::before {
  background:
    radial-gradient(ellipse at 20% 35%, rgba(226, 186, 104, 0.95) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(154, 106, 34, 0.96) 0%, transparent 65%),
    linear-gradient(135deg, #d0a14e 0%, #b58332 55%, #9a6c22 100%);
  box-shadow: 0 4px 12px rgba(132, 92, 28, 0.28), inset 0 0 8px rgba(96, 64, 16, 0.35);
  border: 1px solid rgba(255, 244, 214, 0.4);
}

.btn-wc-ochre:hover::before {
  background:
    radial-gradient(ellipse at 25% 35%, rgba(235, 198, 118, 0.98) 0%, transparent 60%),
    linear-gradient(135deg, #dab060 0%, #c18f3d 55%, #a57629 100%);
}

/* Soft Parchment Outline brush button */
.btn-wc-soft {
  color: var(--granata-deep);
}

.btn-wc-soft::before {
  background: linear-gradient(135deg, rgba(252, 246, 236, 0.92), rgba(240, 226, 204, 0.9));
  border: 1.5px solid rgba(122, 34, 52, 0.42);
  box-shadow: 0 3px 10px rgba(68, 44, 28, 0.1);
}

.btn-wc-sm {
  padding: 7px 16px;
  font-size: 0.88rem;
}

/* Watercolor Pill Badge */
.wc-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 15px;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fffaf0;
  text-shadow: 0 1px 2px rgba(56, 36, 12, 0.45);
  z-index: 1;
}

.wc-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 16px 22px 15px 20px / 13px 18px 14px 17px;
  background:
    radial-gradient(ellipse at 25% 30%, rgba(232, 190, 108, 0.96) 0%, transparent 62%),
    linear-gradient(135deg, #d4a652 0%, #ad7f32 100%);
  box-shadow: 0 2px 9px rgba(48, 32, 12, 0.22), inset 0 0 6px rgba(110, 74, 18, 0.25);
}

.wc-badge-granata::before {
  background:
    radial-gradient(ellipse at 25% 30%, rgba(146, 38, 60, 0.94) 0%, transparent 62%),
    linear-gradient(135deg, #761d30 0%, #4e0f1d 100%);
  box-shadow: 0 2px 9px rgba(56, 12, 22, 0.28), inset 0 0 6px rgba(32, 4, 10, 0.35);
}

.wc-badge-river::before {
  background:
    radial-gradient(ellipse at 25% 30%, rgba(92, 138, 160, 0.94) 0%, transparent 62%),
    linear-gradient(135deg, #4e788c 0%, #345668 100%);
  box-shadow: 0 2px 9px rgba(32, 54, 68, 0.25), inset 0 0 6px rgba(20, 38, 48, 0.3);
}

/* ==========================================================================
   HERO WATERCOLOR BANNER
   ========================================================================== */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 440px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 3px solid rgba(186, 144, 78, 0.45);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(26, 22, 18, 0.62) 0%, rgba(34, 28, 22, 0.42) 48%, rgba(28, 24, 18, 0.14) 100%),
    radial-gradient(rgba(255, 248, 232, 0.08) 0.7px, transparent 0.7px);
  background-size: auto, 14px 14px;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 58px 0 76px;
  max-width: 650px;
}

.hero-title {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.4vw, 3.55rem);
  font-weight: 700;
  line-height: 1.08;
  color: #fffdf8;
  text-shadow: 0 2px 14px rgba(18, 12, 8, 0.55);
}

.hero-subtitle {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #f7efe2;
  text-shadow: 0 1px 8px rgba(18, 12, 8, 0.55);
}

.hero-motto {
  margin: 0 0 26px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.18rem;
  color: #f1dbb3;
  text-shadow: 0 1px 8px rgba(18, 12, 8, 0.6);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* ==========================================================================
   WATERCOLOR CARDS & PANELS
   ========================================================================== */
.home-pillars {
  margin-top: -42px;
  position: relative;
  z-index: 5;
  padding-bottom: 36px;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.wc-card {
  position: relative;
  background: var(--paper-card);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-card);
  border: 1.5px solid rgba(156, 110, 74, 0.34);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
  display: flex;
  flex-direction: column;
}

/* Hand-painted watercolor edge ring */
.wc-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  border: 1.5px solid rgba(126, 36, 52, 0.22);
  pointer-events: none;
}

.wc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.wc-card-clickable {
  cursor: pointer;
}

.pillar-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.48rem;
  font-weight: 700;
  color: var(--ink-dark);
  text-align: center;
}

.pillar-media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: 14px;
  border: 1px solid rgba(140, 102, 72, 0.25);
  background: #eae0d0;
}

.pillar-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pillar-media .wc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.pillar-heading {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--granata-deep);
  line-height: 1.22;
}

.pillar-meta {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0;
}

/* ==========================================================================
   SECTIONS, SUB-TABS, CONTENT GRIDS & LIGHTBOX
   ========================================================================== */
.page-section {
  padding: 40px 0 64px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(182, 138, 72, 0.35);
}

.section-title {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--granata-deep);
  line-height: 1.15;
}

.section-subtitle {
  margin: 6px 0 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink-muted);
  max-width: 720px;
}

/* Filter tabs */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  align-items: center;
}

.search-input {
  margin-left: auto;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1.5px solid rgba(156, 110, 74, 0.42);
  background: rgba(255, 252, 246, 0.9);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink-dark);
  min-width: 220px;
}

.search-input:focus {
  outline: none;
  border-color: var(--granata);
  box-shadow: 0 0 0 3px rgba(104, 24, 40, 0.12);
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.cards-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 24px;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(140, 102, 72, 0.25);
  background: #ede4d5;
}

.card-thumb-contain {
  object-fit: contain;
  background: #f8f3ea;
  padding: 4px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 700;
  color: var(--ink-dark);
  line-height: 1.22;
}

.card-excerpt {
  margin: 0 0 16px;
  font-size: 0.94rem;
  color: var(--ink-body);
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed rgba(156, 110, 74, 0.3);
  font-size: 0.86rem;
  color: var(--ink-muted);
}

/* Video responsive embed */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1412;
  margin-bottom: 12px;
  border: 1px solid rgba(140, 102, 72, 0.35);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-lazy-btn {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: radial-gradient(circle at 30% 25%, #3d1d24 0%, #231417 72%, #170d0f 100%);
  color: #f7f1e6;
  display: block;
  overflow: hidden;
  text-align: center;
}

.yt-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.84) contrast(1.04);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.yt-lazy-btn:hover .yt-thumb-img {
  transform: scale(1.03);
  filter: brightness(0.95) contrast(1.06);
}

.yt-play-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(to top, rgba(20, 11, 13, 0.72) 0%, rgba(20, 11, 13, 0.18) 55%, rgba(20, 11, 13, 0.28) 100%);
}

.yt-privacy-note {
  font-size: 0.74rem;
  line-height: 1.25;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 11, 13, 0.72);
  color: #f5ebd8;
  border: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 92%;
}

.osm-static-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(156, 110, 74, 0.35);
  aspect-ratio: 16 / 11;
  background: #ede4d5;
}

.osm-static-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.osm-static-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(250, 246, 238, 0.94);
  border: 1px solid rgba(140, 102, 72, 0.38);
  box-shadow: 0 4px 14px rgba(32, 18, 14, 0.16);
}

.osm-static-note {
  font-size: 0.78rem;
  color: var(--ink-main);
  font-weight: 500;
}

/* Long-form Article / Reader Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(28, 16, 14, 0.68);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fcf7ee 0%, #f5ebdc 100%);
  border-radius: 18px;
  padding: 32px;
  border: 2px solid rgba(176, 132, 68, 0.55);
  box-shadow: 0 24px 60px rgba(18, 10, 8, 0.45);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 10;
  background: var(--granata);
  color: #fffaf0;
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.reader-prose {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 1.78;
  color: var(--ink-dark);
}

.reader-prose p {
  margin: 0 0 14px;
}

.reader-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.reader-gallery img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #f1e7d6;
  border-radius: 10px;
  border: 1px solid rgba(156, 110, 74, 0.35);
  cursor: zoom-in;
  padding: 4px;
}

/* Inline figures interleaved inside articles and step-by-step guides */
.inline-figures-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 18px 0 22px;
}

.inline-figures-grid.single-col {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.inline-figure {
  margin: 0;
  background: rgba(255, 252, 246, 0.92);
  border: 1.5px solid rgba(156, 110, 74, 0.35);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(56, 34, 24, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-figure img {
  width: 100%;
  max-height: 270px;
  object-fit: contain;
  background: #f3eadc;
  border-radius: 8px;
  cursor: zoom-in;
}

.inline-figure figcaption {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.48;
  color: var(--ink-dark);
}

@media (max-width: 640px) {
  .inline-figures-grid {
    grid-template-columns: 1fr;
  }
}

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(16, 10, 8, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-backdrop.hidden {
  display: none;
}

.lightbox-backdrop img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  background: #fff;
}

/* ==========================================================================
   ADMIN PANEL (AREA SOCI)
   ========================================================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-dark);
}

.form-control {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(156, 110, 74, 0.42);
  background: #fffdf9;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink-dark);
}

.form-control:focus {
  outline: none;
  border-color: var(--granata);
  box-shadow: 0 0 0 3px rgba(104, 24, 40, 0.12);
}

textarea.form-control {
  min-height: 130px;
  resize: vertical;
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.85);
  border: 1px solid rgba(156, 110, 74, 0.3);
  margin-bottom: 10px;
}

.alert-box {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.94rem;
  margin-bottom: 14px;
}

.alert-error {
  background: rgba(164, 24, 42, 0.12);
  border: 1px solid rgba(164, 24, 42, 0.4);
  color: #7c101d;
}

.alert-ok {
  background: rgba(34, 114, 68, 0.12);
  border: 1px solid rgba(34, 114, 68, 0.4);
  color: #165532;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: linear-gradient(180deg, rgba(72, 14, 26, 0.96) 0%, rgba(46, 8, 16, 0.98) 100%);
  color: #f4ead9;
  padding: 40px 0 24px;
  border-top: 3px solid var(--ochre);
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}

.site-footer h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ochre-light);
  margin: 0 0 10px;
}

.site-footer a {
  color: #f4ead9;
  text-decoration: underline;
  text-decoration-color: rgba(229, 196, 127, 0.45);
}

.footer-bottom {
  border-top: 1px solid rgba(229, 196, 127, 0.22);
  padding-top: 16px;
  font-size: 0.86rem;
  color: rgba(244, 234, 217, 0.78);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

/* ==========================================================================
   RESPONSIVE (MOBILE & COMPACT)
   ========================================================================== */
@media (max-width: 1120px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fbf6ed;
    border-bottom: 2px solid var(--ochre);
    padding: 14px 20px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    box-shadow: 0 12px 28px rgba(42, 24, 18, 0.16);
    z-index: 55;
  }
  .main-nav.open {
    display: flex;
  }
}

@media (max-width: 900px) {
  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-grid-2, .footer-grid, .admin-grid, .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }
  .brand-logo-wrap {
    width: 62px;
    height: 62px;
    margin-bottom: -10px;
  }
  .brand-sub {
    display: none;
  }
  .home-pillars {
    margin-top: -18px;
  }
  .search-input {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .header-inner {
    gap: 6px;
  }
  .brand-link {
    gap: 7px;
  }
  .brand-logo-wrap {
    width: 52px;
    height: 52px;
    margin-bottom: -8px;
  }
  .brand-acronym {
    font-size: 1.08rem;
  }
  .btn-wc-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
}
