/* ============================================================
   OAJ SMOL Valtuustovaalit 2026 – styles.css (Brand Adjusted)
   ============================================================ */

/* --- Design Tokens (Adjusted for smolry.fi) --- */
:root, :host {
  --clr-prim: #0A4597;
  /* SMOL Dark Blue */
  --clr-sec: #64ACDF;
  /* SMOL Light Blue */
  --clr-bg: #f8fafd;
  --clr-surface: #ffffff;
  --clr-card: #ffffff;
  --clr-accent: #0A4597;
  --clr-accent2: #64ACDF;
  --clr-gold: #d4a017;
  --clr-text: #1a2b4a;
  --clr-muted: #5a6a8a;
  --clr-border: rgba(10, 69, 151, 0.12);

  --font-body: 'Montserrat', system-ui, sans-serif;

  --fs-hero: clamp(2.4rem, 5vw, 4.2rem);
  --fs-h2: clamp(1.5rem, 3vw, 2.2rem);
  --fs-h3: clamp(1.1rem, 2vw, 1.4rem);
  --fs-lead: 1.125rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;

  --radius-card: 12px;
  --radius-pill: 100px;
  --shadow-card: 0 10px 30px rgba(10, 69, 151, 0.08), 0 1px 3px rgba(10, 69, 151, 0.04);
  --shadow-glow: 0 0 40px rgba(100, 172, 223, 0.2);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 80svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--clr-prim);
  color: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(10, 69, 151, 0.4) 0%, rgba(100, 172, 223, 0.2) 100%),
    url('herokuva.jpg');
  background-size: cover;
  background-position: center;
  mix-blend-mode: normal;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 800px;
}

.hero-eyebrow {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-sec);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: var(--fs-lead);
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: var(--fs-body);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  opacity: 0.85;
}

.hero-cta {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: #fff;
  color: var(--clr-prim);
  border-radius: var(--radius-pill);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition);
}

.hero-cta:hover {
  transform: translateY(-2px);
  background: var(--clr-sec);
  color: #fff;
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  z-index: 3;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 60px;
}

.hero-wave path {
  fill: var(--clr-bg);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.candidate-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--clr-border);
  padding: 0.85rem 1.5rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--clr-muted);
  border: 1px solid var(--clr-border);
  transition: all var(--transition);
}

.nav-btn:hover {
  color: var(--clr-prim);
  border-color: var(--clr-prim);
  background: rgba(10, 69, 151, 0.05);
}

.nav-btn.active {
  background: var(--clr-prim);
  color: #fff;
  border-color: var(--clr-prim);
}

/* ============================================================
   CANDIDATES GRID
   ============================================================ */
.candidates-section {
  padding: 4rem 1.5rem 6rem;
}

.candidates-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
}

/* ============================================================
   CANDIDATE CARD
   ============================================================ */
.candidate-card {
  background: var(--clr-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.candidate-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(10, 69, 151, 0.12);
}

.card-photo-wrap {
  position: relative;
  width: 100%;
  padding-top: 117.5%;
  /* Match 800x940 cropped portraits */
  overflow: hidden;
  background: #fff;
  /* Match card background */
}

.card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.card-number {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--clr-prim);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--clr-prim);
  line-height: 1.2;
}

.card-school {
  font-size: var(--fs-small);
  color: var(--clr-sec);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-slogan {
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 500;
  color: var(--clr-gold);
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--clr-muted);
  line-height: 1.6;
  margin: 0.5rem 0;
}

.card-cta {
  margin-top: auto;
  font-weight: 700;
  color: var(--clr-prim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10, 43, 85, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.text-only .modal-photo-col {
  display: none !important;
}

.modal {
  background: #fff;
  border-radius: 20px;
  max-width: 960px;
  width: 100%;
  max-height: 90svh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
  display: flex;
}

.modal-inner {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  /* Constraint for flex children */
}

.modal-photo-col {
  width: 340px;
  background: #f0f4f8;
  display: flex;
  flex-direction: column;
}

.modal-photo-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.modal-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.modal-meta {
  padding: 1.5rem;
  background: var(--clr-prim);
  color: #fff;
}

.modal-number {
  font-weight: 800;
  font-size: 1.2rem;
  display: block;
}

.modal-text-col {
  flex: 1;
  padding: 3rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  /* Essential for flex-child scrolling */
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2.5rem;
  line-height: 0.5;
  color: var(--clr-muted);
}

.modal-name {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--clr-prim);
  margin-bottom: 0.5rem;
}

.modal-slogan {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--clr-gold);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--clr-sec);
  padding-left: 1rem;
}

.modal-bio {
  color: var(--clr-text);
  margin-bottom: 2rem;
  flex: 1;
  overflow-y: auto;
  padding-right: 1.5rem;
  /* Space for scrollbar */
}

.modal-bio p {
  margin-bottom: 1.2rem;
}

.modal-link {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--clr-prim);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 800px) {
  :root, :host {
    --fs-hero: clamp(1.9rem, 7vw, 2.6rem);
    --fs-h2: clamp(1.25rem, 4.5vw, 1.7rem);
    --fs-h3: clamp(1rem, 3.5vw, 1.25rem);
    --fs-lead: 1rem;
    --fs-body: 0.95rem;
    --fs-small: 0.82rem;
    --fs-label: 0.7rem;
  }

  .hero {
    min-height: 70svh;
  }

  .hero-content {
    padding: 3rem 1.25rem;
  }

  .hero-cta {
    padding: 0.85rem 2rem;
  }

  .candidate-nav {
    padding: 0.65rem 1rem;
  }

  .nav-inner {
    gap: 0.5rem;
  }

  .nav-btn {
    padding: 0.45rem 1rem;
  }

  .candidates-section {
    padding: 3rem 1.25rem 4.5rem;
  }

  .candidates-grid {
    gap: 1.75rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .card-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .card-photo-wrap {
    padding-top: 112%;
  }

  .card-photo {
    object-position: center 18% !important;
  }

  .modal {
    flex-direction: column;
    overflow-y: auto;
    max-height: 92svh;
  }

  .modal-inner {
    flex-direction: column;
  }

  .modal-photo-col {
    display: block;
    width: 100%;
    height: 74px;
    background: #eef3f9;
  }

  .modal-photo {
    object-fit: cover;
    object-position: center 12%;
  }

  .modal-meta {
    display: none;
  }

  .modal-text-col {
    padding: 1.5rem;
  }

  .modal-name {
    font-size: 1.45rem;
  }

  .modal-slogan {
    font-size: 1rem;
    margin-bottom: 1.1rem;
  }

  .modal-meta {
    padding: 1rem;
  }

  .modal-number {
    font-size: 1rem;
  }

  .modal-school {
    font-size: 0.85rem;
  }

  .modal-bio {
    font-size: 0.92rem;
    padding-right: 0.5rem;
  }

  .modal-link {
    padding: 0;
    font-size: 0.85rem;
    background: transparent;
    color: var(--clr-muted);
    border-radius: 0;
    text-decoration: none;
  }

  .candidates-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero-title {
    letter-spacing: -0.02em;
  }

  .hero-description {
    margin-bottom: 2rem;
  }

  .hero-cta {
    width: 100%;
    text-align: center;
  }

  .nav-inner {
    justify-content: flex-start;
  }

  .nav-btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .card-slogan,
  .card-excerpt {
    font-size: 0.9rem;
  }

  .card-photo-wrap {
    padding-top: 106%;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
  }

  .modal-text-col {
    padding: 1.25rem;
  }
}

@media (max-width: 420px) {
  .hero-content {
    padding: 2.5rem 1rem;
  }

  .hero-cta {
    padding: 0.8rem 1.25rem;
  }

  .candidates-section {
    padding: 2.5rem 1rem 4rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-photo-wrap {
    padding-top: 100%;
  }

  .card-photo {
    object-position: center 22% !important;
  }

  .modal-photo-col {
    height: 58px;
  }

  .modal-photo {
    object-position: center 15%;
  }

  .modal-name {
    font-size: 1.35rem;
  }

  .modal-slogan {
    font-size: 0.95rem;
  }

  .modal-meta {
    padding: 0.85rem;
  }

  .modal-number {
    font-size: 0.95rem;
  }

  .modal-school {
    font-size: 0.8rem;
  }

  .modal-bio {
    font-size: 0.9rem;
  }
}

/* FOOTER */
.site-footer {
  background: #fff;
  padding: 3rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--clr-border);
}

.footer-org {
  font-weight: 800;
  color: var(--clr-prim);
}

.footer-sub {
  color: var(--clr-muted);
  font-size: 0.9rem;
}

/* --- Lightbox / Full-Screen Image --- */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-overlay.open img {
  transform: scale(1);
}

.modal-photo {
  cursor: zoom-in;
}

@media (max-width: 800px) {
  .lightbox-overlay img {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    box-shadow: none;
    transform: none;
  }
}
/* Syysliittokokous: vaali-sivuston kortit ja esittelyt, nykyinen SMOL-ilme. */
@font-face{font-family:Imprima;src:url('imprima-regular.ttf') format('truetype');font-display:swap}
@font-face{font-family:Amaranth;src:url('amaranth-bold.ttf') format('truetype');font-weight:700;font-display:swap}
:root,:host{--font-body:Imprima,Arial,sans-serif;--clr-sec:#1493b3;--clr-bg:#f4f8fc}
h1,h2,h3,.footer-org{font-family:Amaranth,Arial,sans-serif}
[hidden]{display:none!important}
.hero{min-height:0;padding:56px 24px 64px}.hero-bg{background-image:linear-gradient(135deg,rgba(10,69,151,.82),rgba(10,69,151,.60)),url('showcase-hero.jpg')}.hero-title{font-weight:700}.hero-description{margin-bottom:0}.showcase-brand{display:inline-block;margin-bottom:20px}.showcase-brand img{border-radius:8px}
.candidate-nav{position:relative}.nav-btn{font-size:1rem}.sort-label{display:flex;align-items:center;gap:8px}select{font:inherit;padding:8px;border:1px solid #b7c8dc;border-radius:8px;background:white;color:var(--clr-text)}
.candidates-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));align-items:start;gap:28px}.candidates-section{max-width:1248px;margin:auto;padding:32px 24px 64px}#result-count{margin-bottom:20px;color:var(--clr-muted)}
.card-photo-wrap{padding:0;aspect-ratio:3/4}.card-photo{position:static;width:100%;height:100%;object-fit:cover}.card-body{padding:24px}.card-name{font-size:1.7rem}.role-badges{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.role-badges span{font-size:.9rem;padding:4px 10px;border-radius:16px;background:#e4f3f8;color:#08446b}.card-school{margin:12px 0}
summary{cursor:pointer;color:#0a4597;font-weight:bold;padding:10px 0}.candidate-full{padding-top:18px}.candidate-full p{margin-bottom:18px}.presentation{white-space:pre-wrap;overflow-wrap:anywhere}.candidate-full h3{margin:24px 0 12px}.card-name,.workplace,.membership{overflow-wrap:anywhere}
#candidate-dialog{position:fixed;margin:auto;width:min(1040px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:40px;border:0;border-radius:20px;color:var(--clr-text);background:white;overflow:auto}#candidate-dialog::backdrop{background:rgba(7,27,54,.75)}.dialog-layout{display:grid;grid-template-columns:minmax(200px,1fr) minmax(0,1.8fr);gap:32px}#dialog-photo img{width:100%;height:auto;border-radius:12px}#dialog-name{font-size:2.2rem;padding-right:28px}.dialog-close{position:sticky;top:0;float:right;margin:-24px -24px 0 0;width:44px;height:44px;border-radius:50%;font-size:32px;background:#0a4597;color:white;z-index:1}.dialog-open{overflow:hidden}
.empty-state{max-width:850px;margin:60px auto;padding:24px;text-align:center}.empty-state h2{margin-bottom:16px}.skip-link{position:absolute;left:12px;top:-100px;z-index:200;background:white;padding:12px}.skip-link:focus{top:12px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}:focus-visible{outline:3px solid #e9a71b;outline-offset:4px}
@media(max-width:700px){.hero{padding:32px 20px}.hero-title{font-size:2.4rem}.nav-inner{justify-content:flex-start}.candidate-nav{padding:16px}.candidates-section{padding:24px 16px 40px}.dialog-layout{grid-template-columns:1fr}#candidate-dialog{padding:24px}#dialog-photo{max-width:240px;margin:auto}.dialog-close{margin:-12px -12px 0 0}.card-photo-wrap{aspect-ratio:3/4}#dialog-name{font-size:1.8rem}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.hero-eyebrow{color:#c4eaff}.card-school{color:#365b7b;text-transform:none}.nav-btn{flex:0 1 auto}.hero-content{padding:24px 12px}

/* Compact standalone page and WordPress embed. */
.showcase-heading{max-width:1248px;margin:auto;padding:28px 24px 20px}
.showcase-heading h1{font-size:clamp(1.7rem,4vw,2.4rem);color:#0a4597;margin-bottom:6px}
.showcase-heading p{color:#365b7b}
.embedded-showcase{background:transparent}
.embedded-showcase .candidate-nav{padding:12px 16px;background:white}
.embedded-showcase .nav-inner{justify-content:flex-start}
.embedded-showcase .candidates-section{padding:20px 16px 32px}
.embedded-showcase .candidate-full{max-width:760px}

.preview-notice{margin:12px 16px;padding:12px 16px;background:#fff3cd;border:1px solid #ddc372;border-radius:8px;color:#594511}



#candidate-dialog{font-family:var(--font-body);font-size:16px;line-height:1.6;text-align:left}

/* Distinct candidacy colors shared by cards and modal. */
.role-badges .role-regular{background:#dcecff;color:#164579}
.role-badges .role-deputy{background:#fff0cc;color:#704a00}
.role-badges .role-chair{background:#eee1f8;color:#633487}

/* A separate touch-scroll area works independently of the locked page. */
#candidate-dialog{overflow:hidden;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px)}
.dialog-scroll{min-height:0;max-height:calc(100vh - 112px);max-height:calc(100dvh - 112px);overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch}
#candidate-dialog .dialog-close{position:absolute;top:12px;right:12px;float:none;margin:0}
@media(max-width:700px){.dialog-scroll{max-height:calc(100vh - 80px);max-height:calc(100dvh - 80px)}#candidate-dialog .dialog-close{top:8px;right:8px}}

/* Text-first phone presentation, following the council-election page. */
@media(max-width:700px){
 #candidate-dialog #dialog-photo{display:none}
 #candidate-dialog #dialog-name{font-size:1.5rem;padding-right:36px;line-height:1.25}
 #candidate-dialog .dialog-layout{display:block}
 #candidate-dialog .role-badges{margin:12px 0}
 #candidate-dialog .candidate-full{padding-top:8px}
}

/* One native button covers the card; its accessible name identifies the candidate. */
.candidate-card{position:relative;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.card-open{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:inherit;background:transparent;cursor:pointer;z-index:1;padding:0}
.candidate-card:has(.card-open:focus-visible){outline:3px solid #e9a71b;outline-offset:4px}
.card-open:focus-visible{outline:none}
@media(hover:hover) and (pointer:fine){.candidate-card:hover{transform:translateY(-6px);border-color:#64acdf;box-shadow:0 15px 40px rgba(10,69,151,.18)}}
@media(hover:none){.candidate-card:hover{transform:none}}
@keyframes candidate-modal-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@keyframes candidate-modal-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY(8px) scale(.98)}}
@keyframes candidate-backdrop-in{from{opacity:0}to{opacity:1}}
@keyframes candidate-backdrop-out{from{opacity:1}to{opacity:0}}
#candidate-dialog[open]{animation:candidate-modal-in .18s ease-out both}
#candidate-dialog[open]::backdrop{animation:candidate-backdrop-in .18s ease-out both}
#candidate-dialog[open].is-closing{animation:candidate-modal-out .18s ease-in both}
#candidate-dialog[open].is-closing::backdrop{animation:candidate-backdrop-out .18s ease-in both}
@media(prefers-reduced-motion:reduce){.candidate-card:hover{transform:none}}
