/* ===================================================
   CHIRO WESTENDE — Modern Theme
   =================================================== */

:root {
  --teal-900: #004d66;
  --teal-800: #005f7f;
  --teal-700: #006f94;
  --teal-600: #0088b3;
  --teal-500: #00a0d2;
  --teal-100: #e0f4fb;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.15);
  --font-display: 'Nunito', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --nav-height: 72px;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--teal-700);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.2;
}

a { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--teal-600); }

img { max-width: 100%; height: auto; }

/* ---- Navigation bar ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--teal-800);
  box-shadow: 0 2px 16px rgba(0,0,0,.2);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo img {
  height: 48px;
  width: auto;
  display: block;
  filter: brightness(1.1);
  transition: transform .2s ease;
}

.nav-logo:hover img {
  transform: scale(1.05);
}

/* ============================================
   DESKTOP NAV — horizontal items with dropdowns
   ============================================ */
.nav-desktop {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
  height: 100%;
  align-items: stretch;
}

.nav-desktop__item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-desktop__label {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .92rem;
  color: rgba(255,255,255,.85);
  cursor: default;
  letter-spacing: .02em;
  transition: color .2s ease, background .2s ease;
  border-radius: 8px;
}

.nav-desktop__item:hover .nav-desktop__label {
  color: var(--white);
  background: rgba(255,255,255,.08);
}

/* ---- Dropdown ---- */
.nav-desktop__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  padding-top: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  pointer-events: none;
}

.nav-desktop__item:hover .nav-desktop__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-desktop__dropdown-inner {
  position: relative;
  background: var(--teal-900);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
}

.nav-desktop__dropdown-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-bg, none) center / cover no-repeat;
  opacity: .45;
  transition: opacity .3s ease;
  pointer-events: none;
}

.nav-desktop__item:hover .nav-desktop__dropdown-inner::before {
  opacity: .55;
}

.nav-desktop__dropdown-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--teal-900) 10%, rgba(0,77,102,.6) 100%);
  pointer-events: none;
}

.nav-desktop__dropdown-inner ul {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-desktop__dropdown-inner ul li a {
  display: block;
  padding: 8px 14px;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  border-radius: 8px;
  transition: background .2s ease, color .15s ease, padding-left .2s ease;
  white-space: nowrap;
}

.nav-desktop__dropdown-inner ul li a:hover {
  background: rgba(255,255,255,.12);
  color: var(--white);
  padding-left: 18px;
}

/* ============================================
   HAMBURGER — hidden on desktop
   ============================================ */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.nav-toggle:hover {
  border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.08);
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] {
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.1);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   MOBILE MENU — mega-menu with cards
   ============================================ */
.mobile-menu {
  display: none;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s cubic-bezier(.4,0,.2,1);
  background: var(--teal-900);
  overflow: hidden;
}

.mobile-menu[aria-hidden="false"] {
  grid-template-rows: 1fr;
}

.mobile-menu__inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 16px;
  transition: padding .4s ease;
}

.mobile-menu[aria-hidden="false"] .mobile-menu__inner {
  padding-top: 16px;
  padding-bottom: 20px;
}

.mobile-menu__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---- Card ---- */
.mobile-menu__card {
  position: relative;
  background: var(--teal-800);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.mobile-menu__card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-bg, none) center / cover no-repeat;
  opacity: .4;
  transition: opacity .3s ease;
  pointer-events: none;
}

.mobile-menu__card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--teal-900) 5%, rgba(0,77,102,.55) 100%);
  pointer-events: none;
}

.mobile-menu__card-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 900;
  color: var(--amber-400);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mobile-menu__card-links {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.mobile-menu__card-links li a {
  display: block;
  padding: 5px 10px;
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  border-radius: 6px;
  transition: background .2s ease, color .15s ease, padding-left .2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu__card-links li a:hover {
  background: rgba(255,255,255,.12);
  color: var(--white);
  padding-left: 14px;
}

/* ---- Main content ---- */
.site-main {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
}

.site-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  box-shadow: var(--shadow-md);
  animation: contentFadeIn .5s ease both;
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-title {
  font-size: 2rem;
  color: var(--teal-800);
  margin: 0 0 8px 0;
}

.article-h1 {
  font-size: 2rem;
  color: var(--teal-800);
  margin: 0 0 24px 0;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--gray-600);
}

.article-body p {
  margin: 0 0 1.25em 0;
}

.article-body img {
  border-radius: var(--radius);
}

/* ---- Footer ---- */
.site-footer {
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 24px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-logo img {
  height: 40px;
  opacity: .7;
  filter: brightness(1.5);
  transition: opacity .2s ease;
}

.footer-logo:hover img {
  opacity: 1;
}

.footer-copy {
  margin: 0;
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  text-align: center;
}

/* ---- Content helpers ---- */
.content-wrapper {
  /* used by page.twig */
}

/* ---- FooGallery overrides ---- */
.foogallery {
  margin-top: 16px;
}

/* ---- Grid legacy (photo pages etc.) ---- */
.grid:after {
  content: '';
  display: block;
  clear: both;
}

.grid-sizer,
.grid-item {
  width: 25%;
}

.grid-item {
  float: left;
}

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

/* ============================================
   RESPONSIVE — switch to mobile menu at 768px
   ============================================ */
@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  /* Hide desktop nav, show hamburger + mobile menu */
  .nav-desktop {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .mobile-menu {
    display: grid;
  }

  .site-content {
    padding: 28px 24px;
    border-radius: var(--radius);
  }

  .site-main {
    margin: 20px auto;
    padding: 0 16px;
  }

  .article-h1,
  .page-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .site-content {
    padding: 24px 20px;
  }

  .mobile-menu__grid {
    grid-template-columns: 1fr;
  }

  .mobile-menu__card {
    min-height: 100px;
  }

  .grid-sizer,
  .grid-item {
    width: 50%;
  }
}
