/* ─── Fiiss Theme ─────────────────────────────────
   Purple (#622599) primary, hero homepage, centered content.
   Inherits Nature theme layout.php but uses this CSS.
   ───────────────────────────────────────────────── */

:root {
  --primary: #622599;
  --primary-light: #f0e6f6;
  --primary-hover: #7a3db5;
  --primary-dark: #4e1d78;
  --text: #2d2d2d;
  --text-muted: #666;
  --bg: #f4f1f7;
  --bg-card: #fff;
  --border: #e2ddd5;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(98,37,153,0.08);
  --shadow-lg: 0 8px 32px rgba(98,37,153,0.12);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ─── Container ──────────────────────────────── */

.container { max-width: 960px; margin: 0 auto; padding: 0 2.5rem; }

/* ─── Header ─────────────────────────────────── */

.site-header {
  background: var(--bg-card);
  border-bottom: 3px solid var(--primary);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: visible;
}

.site-logo { height: 80px; width: auto; border-radius: 8px; transition: transform 0.2s; }
.site-logo:hover { transform: scale(1.05); }
.site-logo-link:hover { text-decoration: none; }
.site-name { font-size: 1.4rem; font-weight: 700; color: var(--primary); text-decoration: none; letter-spacing: -0.01em; }
.site-name:hover { color: var(--primary-hover); text-decoration: none; }
.site-tagline { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.1rem; }

nav a { margin-left: 1.25rem; color: var(--text); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; text-decoration: none; }
nav a:hover { color: var(--primary); }
nav a.active { color: var(--primary); font-weight: 600; border-bottom: 2px solid var(--primary); padding-bottom: 2px; }
nav a.active:hover { text-decoration: none; }

/* Hamburger button - hidden on desktop */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; gap: 5px; flex-direction: column; justify-content: center; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.menu-open .hamburger span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-open .hamburger span:nth-child(2) { opacity: 0; }
.menu-open .hamburger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.header-right { display: flex; align-items: center; gap: 1.5rem; }

/* ─── Language Switcher ─────────────────────── */

.lang-switcher { display: flex; gap: 0.3rem; }
.lang-link { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--primary-light); color: var(--primary); transition: all 0.2s; text-decoration: none; }
.lang-link:hover { background: var(--primary); color: #fff; text-decoration: none; }
.lang-link.active { background: var(--primary); color: #fff; }

/* ─── Page Content (regular pages) ──────────── */

.page-content { padding: 2.5rem 0 3rem; flex: 1; }

.page-title {
  max-width: 720px;
  margin: 0 auto 2rem;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
}

.page-content:not(.home-page) h1 { display: none; }
.page-content:not(.home-page) h2 {
  max-width: 720px;
  margin: 2rem auto 0.75rem;
  font-size: 1.7rem;
  color: var(--primary);
  text-align: center;
}
.page-content:not(.home-page) h3 {
  max-width: 720px;
  margin: 1.5rem auto 0.5rem;
  font-size: 1.35rem;
  color: var(--primary-dark);
  font-weight: 600;
  text-align: center;
}
.page-content:not(.home-page) p {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}
.page-content:not(.home-page) ul {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}
.page-content:not(.home-page) ol {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}
.page-content:not(.home-page) li { margin-bottom: 0.5rem; }

/* Branch cards on regular pages */
.page-content:not(.home-page) > ul > li {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: transform 0.15s, box-shadow 0.15s;
}
.page-content:not(.home-page) > ul > li:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.page-content:not(.home-page) blockquote {
  max-width: 720px;
  margin: 1.5rem auto;
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}
.page-content:not(.home-page) table {
  max-width: 720px;
  margin: 1.25rem auto;
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.page-content th, .page-content td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.page-content th { background: var(--primary); color: #fff; font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.03em; }
.page-content tr:last-child td { border-bottom: none; }
.page-content tr:hover { background: var(--primary-light); }

.page-content a { color: var(--primary); font-weight: 500; }
.page-content a:hover { color: var(--primary-hover); }
.page-content img { border-radius: var(--radius); margin: 1rem auto; display: block; }

/* Closing italic callout */
.page-content:not(.home-page) > p:last-of-type > em {
  display: block;
  text-align: center;
  font-size: 1.1rem;
  color: var(--primary);
  margin-top: 2rem;
  padding: 1rem;
  font-style: normal;
  font-weight: 600;
  background: var(--primary-light);
  border-radius: var(--radius);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Branch Hero (subpages with hero frontmatter) ── */

.branch-hero {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 4rem 2rem 3rem;
  margin-bottom: 3rem;
  background-size: cover;
  background-position: center;
  position: relative;
}

.branch-hero-logo {
  height: 140px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  margin-bottom: 0;
}

.branch-logos-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.branch-hero-logo-small {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.branch-hero-overlay {
  position: relative;
  z-index: 2;
  background: rgba(30, 20, 40, 0.55);
  padding: 2rem 2rem 1.5rem;
  border-radius: var(--radius);
  max-width: 720px;
  margin: 0 auto;
}

.branch-hero h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  margin-top: 0;
  border: none;
  padding: 0;
  -webkit-text-stroke: 2px #fff;
  paint-order: stroke fill;
}

.branch-hero p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.92;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,0.7), 1px 1px 0 rgba(0,0,0,0.5), -1px -1px 0 rgba(0,0,0,0.5);
}

/* ─── Homepage Hero ─────────────────────────── */

.home-page { padding: 0 !important; }

.hero-section {
  background: var(--primary-dark);
  background-image: url('/content/images/hero-bg.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.hero-section h2 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #fff;
  border: none;
  padding: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.hero-section .hero-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.85);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.hero-section p {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.scroll-arrow {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  display: inline-block;
  animation: bounce 2s infinite;
  cursor: pointer;
}

.scroll-arrow svg {
  width: 32px;
  height: 32px;
  fill: rgba(255,255,255,0.7);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

/* ─── Homepage Branch Cards ──────────────────── */

.home-branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 900px;
  margin: -1rem auto 3rem;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .home-branches { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .home-branches { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

.branch-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem 1.5rem;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--primary);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.branch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(98,37,153,0.18);
}

.branch-card .branch-logo {
  height: 80px;
  width: auto;
  margin-bottom: 0.5rem;
  object-fit: contain;
}
}

.branch-card h3 {
  color: var(--primary);
  font-size: 1.35rem;
  margin-bottom: 0.15rem;
  border: none;
  padding: 0;
}

.branch-card .branch-age {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.branch-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

/* ─── Homepage Content Sections ──────────────── */

.home-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2.5rem 3rem;
}

.home-content > ul {
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.home-content > ul > li {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: transform 0.15s, box-shadow 0.15s;
  font-size: 1.05rem;
}
.home-content > ul > li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.home-content h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin: 2.5rem 0 0.75rem;
  text-align: center;
}

.home-content p {
  font-size: 1.08rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.home-content > p:last-of-type > em {
  display: block;
  text-align: center;
  font-size: 1.15rem;
  color: var(--primary);
  margin-top: 2.5rem;
  padding: 1.25rem;
  font-style: normal;
  font-weight: 600;
  background: var(--primary-light);
  border-radius: var(--radius);
}

/* ─── CTA Section ───────────────────────────── */

.home-cta {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 2rem;
  background: var(--primary-light);
  border-radius: var(--radius);
  font-size: 1.2rem;
  color: var(--primary-dark);
  font-weight: 600;
}

.home-cta a {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.85rem 2.5rem;
  background: #fff;
  color: var(--primary);
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
  border: 2px solid #fff;
}
.home-cta a:hover { background: var(--primary); color: #fff; text-decoration: none; transform: translateY(-2px); }

/* ─── Map ─────────────────────────────────────── */

#scoutcms-map { border-radius: var(--radius); margin: 1.5rem auto; max-width: 720px; width: 100%; height: 300px; box-shadow: var(--shadow); position: relative; z-index: 1; }
.map-address { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; max-width: 720px; margin-left: auto; margin-right: auto; }

/* ─── Footer ──────────────────────────────────── */

.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.site-footer a { color: rgba(255,255,255,0.9); }
.site-footer a:hover { color: #fff; }
.footer-badge { height: 44px; width: auto; opacity: 0.85; transition: opacity 0.2s; border-radius: 4px; }
.footer-badge:hover { opacity: 1; }

/* ─── Posts List ──────────────────────────────── */

.posts-list { list-style: none; margin: 0; padding: 0; max-width: 720px; margin-left: auto; margin-right: auto; }
.posts-list li { margin-bottom: 1.5rem; padding: 1.5rem; background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); border-left: 4px solid var(--primary); transition: transform 0.15s, box-shadow 0.15s; }
.posts-list li:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.posts-list .post-title { font-size: 1.2rem; font-weight: 600; }
.posts-list .post-date { color: var(--text-muted); font-size: 0.85rem; }
.posts-list .post-excerpt { color: var(--text); margin-top: 0.3rem; }

/* ─── 404 ─────────────────────────────────────── */

.not-found { text-align: center; padding: 4rem 0; }
.not-found h1 { display: block; font-size: 4rem; margin-bottom: 0.5rem; color: var(--primary); }
.not-found p { font-size: 1.1rem; color: var(--text-muted); }

/* ─── Responsive ──────────────────────────────── */

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .header-right {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    gap: 1rem;
    border-top: 2px solid var(--primary);
    z-index: 200;
  }
  .menu-open .header-right { display: flex; }
  .main-nav { display: flex; flex-direction: column; gap: 0; }
  .main-nav a { margin-left: 0; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .main-nav a.active { border-bottom: 2px solid var(--primary); }
  .nav-dropdown { flex-wrap: nowrap; }
  .nav-dropdown-chevron { display: inline-flex; }
  .nav-dropdown-toggle::after { content: ''; }
  .nav-dropdown-menu {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding-left: 1rem;
    background: transparent;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a { font-size: 0.9rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
  .site-logo { height: 60px; }
  .container { padding: 0 1.5rem; }
  .site-footer .container { flex-direction: column; text-align: center; }
  .hero-section { padding: 4rem 1.5rem 3rem; min-height: 35vh; }
  .hero-section h2 { font-size: 2.2rem; }
  .hero-section p { font-size: 1.05rem; }
  .home-branches { grid-template-columns: 1fr 1fr; }
  .branch-card { padding: 1.25rem 1rem; }
  .subnav-bar .container { padding: 0 1.5rem; }
  .subnav-bar a { font-size: 0.85rem; }
  .page-content:not(.home-page) h2 { font-size: 1.5rem; }
  .page-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .site-logo { height: 48px; }
  .site-name { font-size: 1.1rem; }
  .lang-switcher { flex-direction: row; gap: 0.3rem; }
  .lang-link { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
  .container { padding: 0 1.25rem; }
  .hero-section { padding: 3rem 1.25rem 2.5rem; }
  .hero-section h2 { font-size: 1.8rem; }
  .home-branches { grid-template-columns: 1fr; }
  .home-content { padding: 0 1.25rem 2rem; }
  .page-content:not(.home-page) h2 { font-size: 1.3rem; }
  .page-title { font-size: 1.5rem; }
}

/* ─── Dropdown Navigation ─────────────────────── */

.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-toggle { cursor: pointer; }
.nav-dropdown-toggle::after { content: ' ▾'; font-size: 0.7em; }
.nav-dropdown-chevron {
  display: none; /* hidden on desktop, shown on mobile */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
  color: var(--text);
  line-height: 1;
}
.nav-dropdown-chevron svg { fill: currentColor; vertical-align: middle; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  padding: 0.5rem 0;
  margin-top: 0.25rem;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 0.5rem 1rem; color: var(--text); margin: 0; font-size: 0.9rem; white-space: nowrap; }
.nav-dropdown-menu a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }

/* ─── Subnav Bar ─────────────────────────────────── */

.subnav-bar {
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}
.subnav-bar .container {
  display: flex;
  gap: 1rem;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}
.subnav-bar a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.subnav-bar a:hover { color: var(--primary); background: var(--primary-light); }
.subnav-bar a.active { color: var(--primary); font-weight: 600; }