/*
 * Terra Atlántica · interface refinement v1
 * Shared by demo and database-backed pages; no third-party assets.
 * Motion respects reduced-motion and no interaction is hidden on mobile.
 */
:root {
  color-scheme: light;
  --ink: #173b3d;
  --forest: #123b3e;
  --sea: #b6d0c8;
  --sand: #efe4ce;
  --cream: #faf8f2;
  --gold: #bb9154;
  --muted: #536963;
  --stroke: #d6e0d7;
  --shadow-soft: 0 22px 58px -42px rgba(12, 54, 49, .35);
  --radius-card: 16px;
  --radius-small: 9px;
  --content-width: 1240px;
}
html { scroll-padding-top: 110px; }
body { background: var(--cream); text-rendering: optimizeLegibility; }
.wrap { max-width: var(--content-width); padding-inline: clamp(20px, 4vw, 56px); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
a, button, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid #9c682a !important; outline-offset: 3px; }
.skip { top: -80px; position: fixed; background: #fff; padding: 12px 20px; border-radius: 9px; z-index: 999; box-shadow: 0 8px 32px #102b2b22; }
.skip:focus { top: 8px; }
::selection { background: #cadfd1; color: #173b3d; }

/* Slim identity and clear mobile navigation, with ballot always reachable. */
.site-header {
  position: sticky; top: 0; z-index: 70;
  background: rgba(250, 248, 242, .97);
  border-bottom: 1px solid #d7dfd7;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.header-inner { min-height: 86px; gap: 20px; }
.brand { gap: 12px; flex-shrink: 0; letter-spacing: .1em; }
.brand-icon {
  display: grid; place-items: center; width: 45px; height: 45px;
  border: 1px solid #acc1b5; border-radius: 50%;
  font-size: 1.8rem; color: #285f5b;
  background: #e4ede4;
}
.brand strong { font-size: .82rem; line-height: 1.1; display: block; }
.brand small { font-size: .58rem; letter-spacing: .16em; line-height: 1.35; }
.site-header nav { gap: clamp(8px, 2vw, 27px); align-items: center; }
.site-header nav a:not(.nav-ballot) { padding: 11px 0; color: #385954; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: #1f6d5f; }
.nav-ballot {
  min-height: 46px; background: #1d4b4c; border-radius: 999px;
  color: #fff !important; padding: 10px 16px; display: inline-flex;
  gap: 5px; justify-content: center; align-items: center; white-space: nowrap;
  box-shadow: 0 8px 20px -12px #123b3e9c;
}
.nav-ballot:hover { background: #276567; }
.nav-ballot [data-vote-count], .nav-ballot [data-live-count] {
  color: #fff; font-variant-numeric: tabular-nums;
}

/* Editorial hero: meaningful typography, more deliberate visual composition. */
.hero {
  background: radial-gradient(ellipse at 80% 0%, #e9e3d0, transparent 46%),
              linear-gradient(130deg,#edf1e8 0%,#e4e9dc 63%,#e6dfcb 100%);
  border-bottom: 1px solid #d9e1d6;
}
.hero-grid { min-height: 605px; gap: clamp(30px, 5vw, 90px); }
.hero h1 { font-size: clamp(2.7rem, 5.7vw, 5.75rem); max-width: 13ch; letter-spacing: -.045em; line-height: 1.04; }
.hero p { max-width: 520px; color: #3c5750; }
.eyebrow { color: #3b655d; font-size: .72rem; letter-spacing: .17em; }
.hero .eyebrow { display: inline-block; margin-bottom: 4px; }
.button {
  border: 1px solid transparent; border-radius: 999px;
  min-height: 51px; padding: 14px 25px; gap: 24px;
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 28px -18px #103b3990;
}
.button:hover { transform: translateY(-2px); background: #246466; box-shadow: 0 16px 34px -19px #103b3990; }
.button:active { transform: translateY(0); }
.hero-art {
  border-radius: 170px 170px 12px 12px; min-height: 400px; height: min(36vw, 490px);
  background: linear-gradient(150deg, #8cafa3 0%, #7cafa7 46%, #336e75 46.5%, #173f4b 100%);
  box-shadow: 0 28px 65px -37px #264c4f8a; border: 1px solid #d3dfd3;
}
.hero-art::after {
  content: ""; position: absolute; pointer-events: none;
  inset: auto -30% -65% -20%; height: 75%; transform: rotate(-12deg);
  background: #d4e3d5; opacity: .27; border-radius: 50%;
}
.hero-art .circle { width: min(69%, 350px); aspect-ratio: 1; height: auto; top: 14%; right: 9%; background: #f1dbab; }
.art-top, .art-bottom { font-size: clamp(1.4rem, 2.6vw, 2.5rem); text-shadow: 0 2px 12px #0d343633; }
.art-top { top: 45px; left: 35px; }
.art-bottom { bottom: 42px; right: 30px; }
.hero .note { font-size: .85rem !important; color: #43665c; }

/* Cards and page hierarchy. */
.intro { padding-block: clamp(58px, 8vw, 106px) clamp(40px, 5vw, 75px); }
.intro h2, .section-heading h2, .voting h2, .categories > h2 {
  font-family: Georgia, serif; font-weight: 500;
  letter-spacing: -.035em; line-height: 1.15;
}
.categories { padding-bottom: clamp(64px, 9vw, 130px); }
.section-heading { margin-bottom: 28px; }
.category-grid { gap: clamp(12px, 2vw, 22px); }
.category-card {
  border-radius: var(--radius-card);
  min-height: clamp(230px, 24vw, 320px);
  padding: clamp(24px, 3vw, 42px);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.category-card:before {
  content: ""; position: absolute; width: 165px; height: 165px;
  right: -65px; bottom: -74px; border-radius: 50%;
  border: 1px solid currentColor; opacity: .12; pointer-events: none;
}
.category-card .number { color: #41685f; font-variant-numeric: tabular-nums; }
.category-card h3 { font-size: clamp(1.65rem, 2.7vw, 2.5rem); letter-spacing: -.025em; }
.category-card p { line-height: 1.55; }
.category-link:hover, .category-link:focus-visible {
  transform: translateY(-4px); box-shadow: var(--shadow-soft);
  border-color: #a5c0b0;
}
.card-arrow {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid #9fb7a9; border-radius: 50%;
  right: 24px; top: 24px; font-size: 1.15rem;
}
.voting { padding-block: clamp(68px, 9vw, 118px); background: linear-gradient(137deg,#143e41,#0e3033); }
.voting-grid { gap: clamp(38px, 8vw, 110px); }
.voting li { border-bottom-color: #557975; }
.voting li strong { font-size: 1rem; }
.voting .button-light { background: #e4e9d5; color: #123d3d; box-shadow: none; }
.voting .button-light:hover { background: #fff; }
footer { background: #102f31; border-top: 1px solid #355456; }
.footer-inner { align-items: center; }

/* Consistent internal sections and active cards. */
.interior-head {
  background: linear-gradient(145deg,#e7ede5,#eee7d9);
  padding-block: clamp(44px, 7vw, 90px); border-bottom: 1px solid #d6ded3;
}
.interior-head h1 { max-width: 20ch; font-size: clamp(2.45rem,5.1vw,5.2rem); }
.back-link { display: inline-flex; gap: 8px; margin-bottom: 25px; }
.listing, .detail-layout, .ballot-layout { padding-block: clamp(36px, 5vw, 78px) clamp(70px, 8vw, 115px); }
.candidate-grid { gap: 23px; }
.candidate-card {
  border-radius: var(--radius-card); box-shadow: 0 4px 20px -17px #0d363845;
  display: flex; flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.candidate-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); border-color: #b2cbbb; }
.candidate-image { overflow: hidden; }
.candidate-image img { height: 100%; width: 100%; object-fit: cover; transition: transform .25s ease; }
.candidate-card:hover .candidate-image img { transform: scale(1.025); }
.candidate-body { display: flex; flex-direction: column; flex: 1; padding: 27px; }
.candidate-body h2 { font-size: clamp(1.55rem, 2vw, 1.9rem); line-height: 1.18; }
.candidate-body p { min-height: 0; flex: 1; }
.candidate-actions { margin-top: auto; padding-top: 18px; }
.select-button {
  border-radius: 999px; padding: 11px 18px; min-height: 44px; line-height: 1.3;
  transition: background-color .18s ease, color .18s ease;
}
.select-button:hover { background: #276466; }
.select-button.is-selected { border-color: #2b715c; color: #1e604e; background: #e7f1e9; }
.detail-photo { border-radius: var(--radius-card); overflow: hidden; }
.detail-aside, .ballot-summary {
  border-radius: var(--radius-card); border: 1px solid #d0ded2;
  box-shadow: var(--shadow-soft); top: 105px;
}
.detail-aside .button, .ballot-summary .button { border-radius: 999px; }
.real-gallery { gap: 12px; }
.real-gallery a { overflow: hidden; border-radius: var(--radius-small); }
.real-gallery a img { transition: transform .2s ease; }
.real-gallery a:hover img { transform: scale(1.04); }
.ballot-category { border-radius: 12px; box-shadow: 0 8px 24px -23px #093b3b55; }
.ballot-category h2 { line-height: 1.25; }
.ballot-category-actions { justify-content: space-between; }
.ballot-summary { background: #e4ede5; }
#vote-form input[type="email"] {
  min-height: 48px; border: 1px solid #9eb8ad; border-radius: 8px !important;
  background: #fff; color: var(--ink);
}
#vote-form input[type="checkbox"] { accent-color: #195c50; min-width: 18px; min-height: 18px; }
#live-feedback:not(:empty) { padding: 12px 14px; background: #f9f9f2; border-radius: 8px; }
.demo-note, .note { line-height: 1.6; }

/* UI helpers shared by both the test catalog and the active catalog. */
.page-notice {
  max-width: 760px; display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 17px; margin: 22px 0 0; border: 1px solid #b5cab8;
  border-radius: 10px; background: #f0f5eb; color: #244c42; font-size: .89rem;
}
.page-notice strong { font-weight: 800; }
.demo-banner { background: #123e40; padding: 9px 15px; }
.ballot-progress {
  height: 9px; border-radius: 100px; background: #cadad1;
  overflow: hidden; margin-block: 14px 10px;
}
.ballot-progress__fill {
  width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg,#448c74,#1a584f); transition: width .2s ease;
}
.ballot-hint { color: #466459; margin: 0; font-size: .87rem; }
.empty-catalog {
  border: 1px dashed #acbfb4; border-radius: 14px; background: #f2f5ef;
  padding: 30px; color: #49675a; grid-column: 1/-1;
}
.mobile-ballot-link { display: none; }

@media (max-width: 1000px) {
  .header-inner { gap: 12px; }
  .site-header nav { gap: 15px; }
  .hero-grid { gap: 30px; min-height: 520px; }
  .hero-art { min-height: 330px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 145px; }
  .site-header { position: sticky; }
  .header-inner {
    flex-direction: column; align-items: stretch; gap: 0;
    padding-block: 11px; min-height: 0;
  }
  .brand { align-self: flex-start; }
  .site-header nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
  .site-header nav a:not(.nav-ballot) {
    padding: 6px 8px; font-size: .8rem;
  }
  .site-header nav .nav-ballot { margin-left: auto; padding: 8px 12px; min-height: 37px; font-size: .8rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; min-height: auto; padding-block: 53px 50px; }
  .hero h1 { max-width: 15ch; }
  .hero-art { min-height: 280px; height: 330px; max-width: 480px; width: 100%; margin: auto; }
  .intro { gap: 16px; }
  .category-card { min-height: 225px; }
  .candidate-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-layout, .ballot-layout { grid-template-columns: 1fr; }
  .detail-aside, .ballot-summary { position: static; }
  .voting-grid { grid-template-columns: 1fr; }
  .gallery-placeholders { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 560px) {
  .candidate-grid, .category-grid { grid-template-columns: 1fr; }
  .site-header nav { margin-top: 8px; }
  .site-header nav a:not(.nav-ballot) {
    display: inline-flex;
    align-items: center;
    padding: 7px 9px;
    font-size: .79rem;
  }
  .site-header nav .nav-ballot { width: 100%; margin-left: 0; order: 2; }
  .brand-icon { width: 38px; height: 38px; font-size: 1.45rem; }
  .hero-art { min-height: 250px; height: 280px; }
  .hero-art .circle { width: 65%; }
  .art-top,.art-bottom { font-size: 1.45rem; }
  .card-arrow { right: 19px; top: 18px; }
  .category-card { min-height: 215px; }
  .candidate-body { padding: 21px; }
  .ballot-category { padding: 20px; }
  .interior-head h1 { font-size: clamp(2.2rem, 10vw, 3.5rem); }
  .voting li { grid-template-columns: 28px 80px 1fr; }
  .footer-inner { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (prefers-contrast: more) {
  :root { --muted: #314a43; --stroke: #71877c; }
  .category-card, .candidate-card, .ballot-category { border-width: 2px; }
}
