/* ===========================
   Global variables
   =========================== */

:root {
  --color-bg: #fdfdf6;
  --color-text: #114444;
  --color-accent: #1d4e4e;
  --color-accent-dark: #0c3232;
  --color-accent-soft: #c4cbc6;
  --color-accent-active: #2a6666;
  --color-border: #d8ddd7;
  --color-muted: #6c7b7b;

  --font-body: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-soft: 0 4px 10px rgba(0, 0, 0, 0.08);

  --header-height-mobile: 80px;

  /* Sidebar / gallery width:
     225px at 750px viewport,
     325px at 1280px viewport, linear in between. */
  --sidebar-w: clamp(
    225px,
    calc(225px + (325 - 225) * ((100vw - 750px) / (1280 - 750))),
    325px
  );
}

/* ===========================
   Reset / base
   =========================== */

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

/* Ensure the hidden attribute always hides */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

button {
  font: inherit;
}

/* Utility classes */

.text-muted {
  color: var(--color-muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.stack--sm {
  gap: var(--space-sm);
}

/* ===========================
   Layout shell
   =========================== */

.site-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ===========================
   Header / global Menu button
   =========================== */

/* Desktop: header is overlay with zero height so it
   doesn’t push the sidebar/content down. */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  z-index: 60;
  pointer-events: none;
}

.site-header__inner {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: var(--space-md) var(--space-xl) 0;
  pointer-events: auto;
}

/* Logo is mobile-only */
.site-header__logo {
  display: none;
  margin-right: auto;
}

.site-header__logo img {
  height: 58px;
}

/* Dropdown container */
.nav-dropdown {
  position: relative;
}

/* Single Menu button */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

/* Desktop-only hover state for Menu button */
@media (min-width: 750px) {
  .nav-toggle:hover,
  .nav-toggle:focus-visible {
    background: var(--color-accent-active);
  }
}

.nav-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Dropdown panel (desktop defaults) */
.nav-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-xs);
  min-width: 230px;
  background: #e3e3dd;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  display: none;
  z-index: 70;
}

.nav-dropdown.is-open .nav-panel {
  display: block;
}

/* Panel lists */

.nav-panel__list,
.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-panel__list {
  padding: var(--space-xs) 0;
}

.nav-panel__item {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-panel__item:first-child {
  border-top: none;
}

.nav-panel__link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem var(--space-md);
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
}

.nav-panel__link:hover,
.nav-panel__link:focus-visible {
  background: #c4cbc6;
  text-decoration: none;
}

/* Parent items (with accordion) */

.nav-panel__link--parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Submenus */

.nav-submenu {
  display: none;
  background: #f1f1ec;
  padding-bottom: var(--space-xs);
}

.nav-panel__item--open > .nav-submenu {
  display: block;
}

.nav-submenu__item a {
  display: block;
  padding: 0.45rem calc(var(--space-md) * 2);
  font-size: 0.9rem;
}

.nav-submenu__item a:hover,
.nav-submenu__item a:focus-visible {
  background: #d8ddd7;
  text-decoration: none;
}

/* Ensure correct text colour in all dropdowns (desktop + mobile) */
.nav-panel,
.nav-panel__link,
.nav-submenu__item a {
  color: var(--color-text);
}

/* ===========================
   Sidebar (desktop / tablet ≥ 750px)
   =========================== */

.site-sidebar {
  background: var(--color-accent);
  color: #fff;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  max-width: 400px;
}

.site-sidebar__logo {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--space-xl) 0 var(--space-2xl);
}

/* Sidebar gallery */

.sidebar-gallery {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 0 calc(var(--space-md) / 2) var(--space-xl);
}

.sidebar-gallery__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  filter: brightness(1.225);
}

/* ===========================
   Main content
   =========================== */

.site-main {
  padding: var(--space-xl);
  max-width: 900px;
}

.section {
  margin-bottom: var(--space-2xl);
}

.section--narrow {
  max-width: 720px;
}

.page-title {
  font-size: 1.9rem;
  margin: 0 0 var(--space-md);
  color: var(--color-accent);
}

.section-title {
  font-size: 1.35rem;
  margin: 0 0 var(--space-sm);
  color: var(--color-accent);
}

p {
  margin: 0 0 var(--space-md);
}

/* Lists */

ul,
ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.25rem;
}

/* ===========================
   Homepage mode switch
   =========================== */

.mode-switch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
  margin: 0 0 var(--space-2xl);
}

.mode-switch__line {
  height: 1px;
  background: var(--color-border);
}

.mode-switch__line:first-of-type {
  grid-column: 1;
}

.mode-switch__line:last-of-type {
  grid-column: 3;
}

.mode-switch__btn {
  grid-column: 2;
  grid-row: 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.mode-switch__btn img {
  width: 300px;
  height: 25px;
}

/* Strong visible focus for keyboard users */
.mode-switch__btn:focus-visible {
  outline: 3px solid #7FA8A1;
  outline-offset: 6px;
  border-radius: 999px;
}

/* Mobile: keep the line (no sidebar anyway) and keep toggle centred */
@media (max-width: 749px) {
  .mode-switch {
    grid-template-columns: 1fr auto 1fr;
    justify-content: center;
    margin: 0 0 var(--space-2xl);
    gap: var(--space-md);
  }

  .mode-switch__line {
    display: block;
  }

  .mode-switch__btn {
    grid-column: 2;
  }
}

/* ===========================
   About page layout
   =========================== */

.about-layout {
  display: grid;
  gap: var(--space-2xl);
}

.about-column {
  max-width: 40rem;
}

/* Two columns on wider screens */
@media (min-width: 1020px) {
  .about-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: flex-start;
  }
}

/* Icon + text rows */
.about-list {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.about-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* Text block beside icon */
.about-list__body h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1.05rem;
  color: var(--color-accent);
}

.about-list__body p {
  margin: 0;
}

/* ===========================
   Home: Location section
   =========================== */

.home-location {
  max-width: 900px;
}

.home-location__map {
  width: 100%;
  height: auto;
  display: block;
  margin-top: var(--space-md);
  border-radius: var(--radius-md);
}


/* ===========================
   Video wrapper (16:9 embeds)
   =========================== */

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===========================
   Intake modal
   =========================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 92, 92, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--color-bg);
  color: var(--color-text);
  max-width: 680px;
  width: calc(100% - 2rem);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal h2 {
  margin: 0 0 var(--space-md);
  color: var(--color-accent);
  font-size: 1.35rem;
}

.modal p {
  margin: 0 0 var(--space-md);
}

.modal p:last-of-type {
  margin-bottom: 0;
}

.modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: rgba(29, 78, 78, 0.08);
  color: var(--color-text);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  align-items: center;
  flex-wrap: wrap;
}

.modal-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #fff;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.modal-primary:hover,
.modal-primary:focus-visible {
  background: var(--color-accent-active);
  text-decoration: none;
}

.modal-secondary {
  background: none;
  border: 0;
  color: var(--color-muted);
  font: inherit;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
}

.modal-secondary:hover,
.modal-secondary:focus-visible {
  color: var(--color-text);
  text-decoration: underline;
}

/* ===========================
   Footer
   =========================== */

.site-footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.site-footer__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.site-footer__contact {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.site-footer__contact a {
  text-decoration: none;
}

.site-footer__contact a:hover,
.site-footer__contact a:focus-visible {
  text-decoration: underline;
}

.site-footer__support {
  font-size: 0.9rem;
}

/* Footer icons */

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ===========================
   Policy / long text pages
   =========================== */

.policy {
  max-width: 720px;
}

.policy h1 {
  font-size: 1.8rem;
  margin: 0 0 var(--space-sm);
  color: var(--color-accent);
}

.policy h2 {
  font-size: 1.2rem;
  margin: var(--space-lg) 0 var(--space-xs);
  color: var(--color-accent);
}

.policy ul {
  margin-bottom: var(--space-md);
}

/* Tables */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  margin: var(--space-md) 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

thead th {
  background: #e3e3dd;
  font-weight: 700;
}

/* ===========================
   Research & reviews lists
   =========================== */

.flex-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.flex-item h3 {
  margin: 0 0 var(--space-xs);
  color: var(--color-accent);
  font-size: 1.05rem;
}

/* ===========================
   Responsive layout
   =========================== */

/* Mobile / small screens: < 750px */

@media (max-width: 749px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    display: none;
  }

  /* Mobile header as full-width topbar */
  .site-header {
    position: sticky;
    top: 0;
    height: var(--header-height-mobile);
    background: var(--color-accent);
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
  }

  .site-header__inner {
    width: 100%;
    padding: 0;
    align-items: center;
    justify-content: space-between;
  }

  .site-header__logo {
    display: flex;
  }

  .site-header__logo img {
    height: 58px;
  }

  /* Right-aligned dropdown that stays inside the viewport */
  .nav-panel {
    position: absolute;
    top: calc(100% + var(--space-xs));
    right: var(--space-md);
    left: auto;
    margin: 0;
    width: min(420px, calc(100% - 2 * var(--space-md)));
  }

  .nav-panel__link,
  .nav-submenu__item a {
    font-size: 1rem;
  }

  /* Mobile: keep button light while menu is open */
  .nav-dropdown.is-open .nav-toggle {
    background: var(--color-accent-active);
  }

  .site-main {
    padding:
      calc(var(--header-height-mobile) - 2.5rem)
      var(--space-md)
      var(--space-xl);
  }
}

/* Very small screens */

@media (max-width: 599px) {
  .site-main {
    padding-inline: var(--space-md);
  }

  .site-footer__contacts {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===========================
   Focus styles
   =========================== */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent-dark);
  outline-offset: 2px;
}

/* End of stylesheet */