/* ==========================================================================
   Tischlerei T. Liersch - Main stylesheet
   Mobile first. Colours derived from the original header image
   (dark wenge wood, saw blade steel) and the oak / ash wood photos.
   ========================================================================== */

/* -------- 1. Design tokens -------- */
:root {
  /* Colours */
  --color-wood-900: #2a1f16;      /* dark wenge - primary */
  --color-wood-800: #3b2d21;
  --color-wood-700: #4d3b2c;
  --color-oak-700: #7a4f18;       /* accent hover */
  --color-oak-600: #8a5a1c;       /* accent (AA on light backgrounds) */
  --color-oak-400: #c39350;
  --color-oak-300: #d9b077;       /* accent on dark backgrounds */
  --color-steel-600: #5c564c;     /* muted text */
  --color-steel-300: #b9b3a9;
  --color-cream-50: #faf7f2;      /* page background */
  --color-cream-100: #f3ece1;     /* alternate sections */
  --color-cream-200: #e8ddcc;     /* borders */
  --color-white: #ffffff;

  --color-bg: var(--color-cream-50);
  --color-surface: var(--color-white);
  --color-surface-alt: var(--color-cream-100);
  --color-text: var(--color-wood-900);
  --color-text-muted: var(--color-steel-600);
  --color-border: var(--color-cream-200);
  --color-accent: var(--color-oak-600);
  --color-accent-hover: var(--color-oak-700);
  --color-on-dark: var(--color-cream-50);
  --color-on-dark-muted: #d8cdbd;

  /* DEMO: demo banner colours - deliberately outside the brand palette.
     Remove at go-live (see DEMO.md). */
  --color-demo-bg: #1f3a5f;       /* white text: 11.5:1 */
  --color-demo-text: #ffffff;
  --color-demo-accent: #a9cdfb;   /* on --color-demo-bg: 7:1 */

  /* Fonts */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-heading: 'Roboto Slab', Georgia, 'Times New Roman', serif;

  /* Layout */
  --radius-sm: 0.375rem;
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --shadow-sm: 0 1px 2px rgba(42, 31, 22, 0.06), 0 1px 3px rgba(42, 31, 22, 0.08);
  --shadow: 0 6px 24px rgba(42, 31, 22, 0.10);
  --shadow-lg: 0 18px 48px rgba(42, 31, 22, 0.18);
  --section-space: 3.5rem;
  --header-height: 4.25rem;
  --transition: 200ms ease;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--color-text);
  --bs-body-bg: var(--color-bg);
  --bs-link-color: var(--color-accent);
  --bs-link-color-rgb: 138, 90, 28;
  --bs-link-hover-color: var(--color-accent-hover);
  --bs-link-hover-color-rgb: 122, 79, 24;
  --bs-border-color: var(--color-border);
  --bs-emphasis-color: var(--color-wood-900);
  --bs-secondary-color: var(--color-text-muted);
  --bs-focus-ring-color: rgba(138, 90, 28, 0.35);
}

@media (min-width: 768px) {
  :root {
    --section-space: 5rem;
  }
}

@media (min-width: 992px) {
  :root {
    --header-height: 5rem;
    --section-space: 6rem;
  }
}

/* -------- 2. Base -------- */
html {
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-wood-900);
  letter-spacing: -0.01em;
}

h1, .h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); }
h2, .h2 { font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.35rem); }
h3, .h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem); }

p { margin-bottom: 1.1rem; }

a {
  color: var(--color-accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color var(--transition);
}

a:hover { color: var(--color-accent-hover); }

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

:focus-visible {
  outline: 3px solid var(--color-oak-400);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--color-oak-300);
  color: var(--color-wood-900);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: -0.2em;
}

.icon-sm { width: 1em; height: 1em; vertical-align: -0.125em; }

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

.lead {
  font-size: clamp(1.075rem, 1rem + 0.35vw, 1.25rem);
  font-weight: 400;
  color: var(--color-text-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.eyebrow::before {
  content: '';
  width: 2rem;
  height: 2px;
  background: currentColor;
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  padding: 0.75rem 1.25rem;
  background: var(--color-wood-900);
  color: var(--color-on-dark);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  color: var(--color-on-dark);
}

/* -------- DEMO: Demo banner (remove at go-live, see DEMO.md) -------- */
.demo-banner {
  background: var(--color-demo-bg);
  color: var(--color-demo-text);
  border-bottom: 3px solid var(--color-demo-accent);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
}

.demo-banner p {
  margin: 0;
  padding: 0.6rem 0;
}

.demo-banner strong {
  color: var(--color-demo-accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* -------- 3. Buttons -------- */
.btn {
  --bs-btn-padding-x: 1.4rem;
  --bs-btn-padding-y: 0.75rem;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.btn:active { transform: translateY(1px); }

.btn-accent {
  --bs-btn-color: var(--color-white);
  --bs-btn-bg: var(--color-accent);
  --bs-btn-border-color: var(--color-accent);
  --bs-btn-hover-color: var(--color-white);
  --bs-btn-hover-bg: var(--color-accent-hover);
  --bs-btn-hover-border-color: var(--color-accent-hover);
  --bs-btn-active-color: var(--color-white);
  --bs-btn-active-bg: var(--color-accent-hover);
  --bs-btn-active-border-color: var(--color-accent-hover);
  --bs-btn-focus-shadow-rgb: 138, 90, 28;
}

.btn-light-accent {
  --bs-btn-color: var(--color-wood-900);
  --bs-btn-bg: var(--color-oak-300);
  --bs-btn-border-color: var(--color-oak-300);
  --bs-btn-hover-color: var(--color-wood-900);
  --bs-btn-hover-bg: #e5c393;
  --bs-btn-hover-border-color: #e5c393;
  --bs-btn-active-color: var(--color-wood-900);
  --bs-btn-active-bg: #e5c393;
  --bs-btn-active-border-color: #e5c393;
}

.btn-outline-light-custom {
  --bs-btn-color: var(--color-on-dark);
  --bs-btn-border-color: rgba(250, 247, 242, 0.55);
  --bs-btn-hover-color: var(--color-wood-900);
  --bs-btn-hover-bg: var(--color-on-dark);
  --bs-btn-hover-border-color: var(--color-on-dark);
  --bs-btn-active-color: var(--color-wood-900);
  --bs-btn-active-bg: var(--color-on-dark);
  --bs-btn-active-border-color: var(--color-on-dark);
}

.btn-outline-accent {
  --bs-btn-color: var(--color-accent);
  --bs-btn-border-color: var(--color-accent);
  --bs-btn-hover-color: var(--color-white);
  --bs-btn-hover-bg: var(--color-accent);
  --bs-btn-hover-border-color: var(--color-accent);
  --bs-btn-active-color: var(--color-white);
  --bs-btn-active-bg: var(--color-accent-hover);
  --bs-btn-active-border-color: var(--color-accent-hover);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  text-decoration: none;
}

.link-arrow .icon { transition: transform var(--transition); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* -------- 4. Top bar (desktop) -------- */
.topbar {
  background: var(--color-wood-900);
  color: var(--color-on-dark-muted);
  font-size: 0.85rem;
}

.topbar a {
  color: var(--color-on-dark-muted);
  text-decoration: none;
}

.topbar a:hover { color: var(--color-oak-300); }

.topbar-list {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
}

.topbar-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar .icon { color: var(--color-oak-300); }

/* -------- 5. Header & navigation -------- */
.site-header {
  background: rgba(250, 247, 242, 0.96);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}

@supports (backdrop-filter: blur(8px)) {
  .site-header {
    background: rgba(250, 247, 242, 0.95);
    backdrop-filter: saturate(160%) blur(12px);
  }
}

.site-header.is-scrolled { box-shadow: var(--shadow-sm); }

.site-header .navbar {
  min-height: var(--header-height);
  padding: 0.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  margin-right: 1rem;
  color: var(--color-wood-900);
  text-decoration: none;
}

.brand:hover { color: var(--color-wood-900); }

.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.6rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-top {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-wood-900);
}

.btn-icon:hover { color: var(--color-accent); border-color: var(--color-accent); }

.navbar-toggler {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-wood-900);
  color: var(--color-on-dark);
}

.navbar-toggler:focus { box-shadow: none; }

.navbar-toggler .icon-close { display: none; }
.navbar-toggler[aria-expanded="true"] .icon-open { display: none; }
.navbar-toggler[aria-expanded="true"] .icon-close { display: inline-block; }

.site-nav {
  gap: 0.15rem;
  padding: 0.75rem 0 1rem;
}

.site-nav .nav-link {
  position: relative;
  padding: 0.75rem 0.25rem;
  font-weight: 500;
  color: var(--color-wood-900);
  border-bottom: 1px solid var(--color-border);
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible { color: var(--color-accent); }

.site-nav .nav-link.active,
.site-nav .nav-link[aria-current="page"] {
  color: var(--color-accent);
  font-weight: 600;
}

/* Split dropdown: link + toggle button */
.nav-split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.nav-split > .nav-link { flex: 1 1 auto; }

.nav-sub-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-wood-900);
  border-bottom: 1px solid var(--color-border);
}

.nav-sub-toggle::after { display: none; }
.nav-sub-toggle .icon { transition: transform var(--transition); }
.nav-sub-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.nav-sub-toggle:hover { color: var(--color-accent); }

.site-nav .dropdown-menu {
  flex-basis: 100%;
  margin: 0;
  padding: 0.25rem 0 0.5rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.site-nav .dropdown-item {
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--color-wood-900);
  font-weight: 500;
}

.site-nav .dropdown-item:hover,
.site-nav .dropdown-item:focus {
  background: var(--color-cream-100);
  color: var(--color-accent);
}

.site-nav .dropdown-item.active,
.site-nav .dropdown-item[aria-current="page"] {
  background: var(--color-cream-100);
  color: var(--color-accent);
  font-weight: 600;
}

.nav-cta { margin-top: 1rem; }

@media (min-width: 992px) {
  .brand-mark { width: 2.9rem; height: 2.9rem; }
  .brand-name { font-size: 1.45rem; }

  .site-nav {
    align-items: center;
    padding: 0;
    gap: 0.25rem;
  }

  .site-nav .nav-link {
    padding: 0.5rem 0.7rem;
    border-bottom: 0;
  }

  .site-nav > .nav-item > .nav-link::after {
    content: '';
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.15rem;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
  }

  .site-nav > .nav-item > .nav-link:hover::after,
  .site-nav > .nav-item > .nav-link[aria-current="page"]::after,
  .site-nav > .nav-item > .nav-link.active::after { transform: scaleX(1); }

  .nav-split {
    position: relative;
    flex-wrap: nowrap;
  }

  .nav-split > .nav-link { padding-right: 0.2rem; }

  .nav-sub-toggle {
    width: 1.75rem;
    height: 2rem;
    border-bottom: 0;
  }

  .site-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 15rem;
    padding: 0.5rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  /* Open on hover / keyboard focus for pointer devices */
  .nav-split:hover > .dropdown-menu,
  .nav-split:focus-within > .dropdown-menu { display: block; }

  .nav-cta {
    margin: 0 0 0 0.75rem;
  }
}

/* -------- 6. Hero (home) -------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 4.5rem 0 4rem;
  color: var(--color-on-dark);
  background-color: var(--color-wood-900);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(42, 31, 22, 0.94) 0%, rgba(42, 31, 22, 0.86) 45%, rgba(42, 31, 22, 0.55) 100%);
}

.hero h1 {
  color: var(--color-white);
  font-size: clamp(2.4rem, 1.5rem + 4.5vw, 4.25rem);
  margin-bottom: 1rem;
}

.hero-sub {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.3rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-oak-300);
}

.hero .eyebrow { color: var(--color-oak-300); }

.hero-lead {
  max-width: 36rem;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  color: var(--color-on-dark-muted);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.75rem 0 2rem;
  padding: 0;
  list-style: none;
}

.hero-tags li {
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(217, 176, 119, 0.45);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--color-on-dark);
  background: rgba(42, 31, 22, 0.35);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .hero { padding: 7rem 0 6.5rem; }
}

@media (min-width: 1200px) {
  .hero { padding: 9rem 0 8rem; }
}

/* -------- 7. Page header (sub pages) -------- */
.page-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 2.75rem 0 2.5rem;
  color: var(--color-on-dark);
  background-color: var(--color-wood-900);
}

.page-header .hero-bg { object-position: 70% 50%; }

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(42, 31, 22, 0.95) 0%, rgba(42, 31, 22, 0.82) 60%, rgba(42, 31, 22, 0.6) 100%);
}

.page-header h1 {
  color: var(--color-white);
  margin: 0;
}

.page-header .breadcrumb {
  --bs-breadcrumb-divider-color: var(--color-on-dark-muted);
  --bs-breadcrumb-item-active-color: var(--color-oak-300);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.page-header .breadcrumb a {
  color: var(--color-on-dark-muted);
  text-decoration: none;
}

.page-header .breadcrumb a:hover { color: var(--color-white); }

@media (min-width: 768px) {
  .page-header { padding: 4rem 0 3.5rem; }
}

/* -------- 8. Sections -------- */
.section { padding: var(--section-space) 0; }
.section-alt { background: var(--color-surface-alt); }
.section-tight { padding: calc(var(--section-space) * 0.6) 0; }

.section-head {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.section-head.text-center { margin-inline: auto; }

.prose { max-width: 46rem; }
.prose p:last-child { margin-bottom: 0; }

.prose-list {
  padding-left: 0;
  list-style: none;
}

.prose-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.6rem;
}

.prose-list li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.6em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--color-oak-400);
  transform: rotate(45deg);
}

/* Image with offset frame */
.framed-img {
  position: relative;
  margin: 0;
}

.framed-img img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.framed-img::before {
  content: '';
  position: absolute;
  inset: 1.25rem -0.75rem -0.75rem 1.25rem;
  border: 2px solid var(--color-oak-300);
  border-radius: var(--radius-lg);
}

@media (min-width: 992px) {
  .framed-img::before { inset: 1.75rem -1.25rem -1.25rem 1.75rem; }
}

.framed-figure { margin: 0; }

.framed-figure figcaption {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

@media (min-width: 992px) {
  .framed-figure figcaption { margin-top: 2.25rem; }
}

/* -------- 9. Cards -------- */
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--color-oak-300);
}

.service-card h3 {
  margin: 1.1rem 0 0.6rem;
  font-size: 1.25rem;
}

.service-card h3 a {
  color: inherit;
  text-decoration: none;
}

/* Whole card clickable via stretched link */
.service-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

.service-card p {
  flex-grow: 1;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.service-card .link-arrow { color: var(--color-accent); }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius);
  background: var(--color-cream-100);
  color: var(--color-accent);
}

.icon-badge .icon { width: 1.6rem; height: 1.6rem; }

.service-card-dark {
  background: var(--color-wood-900);
  border-color: var(--color-wood-900);
  color: var(--color-on-dark);
}

.service-card-dark h3,
.service-card-dark .link-arrow { color: var(--color-white); }
.service-card-dark p { color: var(--color-on-dark-muted); }
.service-card-dark .icon-badge { background: var(--color-wood-700); color: var(--color-oak-300); }

/* Steps: Beratung, Planung, Angebot, Ausführung */
.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  counter-increment: step;
}

.steps li::after {
  content: '0' counter(step);
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-steel-300);
}

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
  .steps li { padding: 1.5rem; }
}

/* Contact cards */
.contact-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.contact-item .icon-badge { width: 2.75rem; height: 2.75rem; flex-shrink: 0; }
.contact-item .icon-badge .icon { width: 1.3rem; height: 1.3rem; }

.contact-label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.contact-item address,
.contact-item p { margin: 0; }

.contact-item a {
  font-weight: 600;
  word-break: break-word;
}

/* Team card */
.team-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.team-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--color-wood-900);
  color: var(--color-oak-300);
}

.team-avatar .icon { width: 2.25rem; height: 2.25rem; }

.team-card h3 { margin: 0; }

.team-role {
  margin: 0.25rem 0 0;
  color: var(--color-accent);
  font-weight: 600;
}

.team-contact {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}

.team-contact li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.team-contact .icon { color: var(--color-accent); }

@media (min-width: 576px) {
  .team-card { flex-direction: row; align-items: flex-start; }
  .team-card-body { flex: 1; }
}

/* Info box */
.info-box {
  padding: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
}

.info-box h2,
.info-box h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.info-box .prose-list { margin-bottom: 0; }

/* -------- 10. Gallery & lightbox -------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 576px) { .gallery { gap: 0.9rem; } }
@media (min-width: 768px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--color-cream-200);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(42, 31, 22, 0.45), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.05); }

.gallery-item:hover::after,
.gallery-item:focus-visible::after { opacity: 1; }

.gallery-zoom {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(250, 247, 242, 0.92);
  color: var(--color-wood-900);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition);
}

.gallery-item:hover .gallery-zoom,
.gallery-item:focus-visible .gallery-zoom {
  opacity: 1;
  transform: none;
}

.gallery-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Lightbox uses the native <dialog> element */
.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(20, 14, 9, 0.96);
  color: var(--color-on-dark);
}

.lightbox::backdrop { background: rgba(20, 14, 9, 0.96); }

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 4rem 0.75rem 1.5rem;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  text-align: center;
  color: var(--color-on-dark-muted);
}

.lightbox-btn {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 247, 242, 0.12);
  color: var(--color-white);
  transition: background-color var(--transition);
}

.lightbox-btn:hover { background: rgba(250, 247, 242, 0.25); }
.lightbox-btn .icon { width: 1.5rem; height: 1.5rem; }
.lightbox-close { top: 0.75rem; right: 0.75rem; }
.lightbox-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

@media (min-width: 768px) {
  .lightbox-figure { padding: 4rem 5rem 2rem; }
  .lightbox-prev { left: 1.25rem; }
  .lightbox-next { right: 1.25rem; }
  .lightbox-close { top: 1.25rem; right: 1.25rem; }
}

body.lightbox-open { overflow: hidden; }

/* -------- 11. CTA band -------- */
.cta-band {
  position: relative;
  overflow: hidden;
  padding: var(--section-space) 0;
  background: var(--color-wood-900);
  color: var(--color-on-dark);
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(100deg, rgba(217, 176, 119, 0.035) 0 2px, transparent 2px 14px);
  pointer-events: none;
}

.cta-band .container { position: relative; }

.cta-band h2 { color: var(--color-white); }
.cta-band .lead { color: var(--color-on-dark-muted); }

.cta-contact {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cta-contact li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(217, 176, 119, 0.25);
  border-radius: var(--radius);
  background: rgba(250, 247, 242, 0.04);
}

.cta-contact .icon { color: var(--color-oak-300); margin-top: 0.2rem; }

.cta-contact a {
  color: var(--color-white);
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}

.cta-contact a:hover { color: var(--color-oak-300); }

.cta-contact address { margin: 0; }

/* -------- 12. Forms -------- */
.form-card {
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .form-card { padding: 2.25rem; }
}

.form-label {
  font-weight: 600;
  font-size: 0.925rem;
}

.form-control {
  padding: 0.75rem 0.95rem;
  border-color: var(--color-cream-200);
  border-radius: var(--radius-sm);
  background-color: var(--color-cream-50);
}

.form-control:focus {
  border-color: var(--color-oak-400);
  background-color: var(--color-white);
  box-shadow: 0 0 0 0.25rem rgba(138, 90, 28, 0.18);
}

.form-check-input:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.form-check-input:focus {
  border-color: var(--color-oak-400);
  box-shadow: 0 0 0 0.25rem rgba(138, 90, 28, 0.18);
}

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

/* Honeypot field (spam protection) - hidden from people */
.form-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 1rem 0 0;
  font-weight: 500;
}

.form-status:empty { display: none; }

.form-status.is-info {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-cream-100);
  border-left: 4px solid var(--color-accent);
}

/* -------- 13. Legal pages -------- */
.legal {
  max-width: 50rem;
  overflow-wrap: anywhere;
}

.legal h2 {
  margin: 3rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.legal h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
}

.legal dl {
  display: grid;
  gap: 0.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.legal dt { font-weight: 600; }
.legal dd { margin-bottom: 0.75rem; }

@media (min-width: 576px) {
  .legal dl { grid-template-columns: minmax(12rem, auto) 1fr; }
  .legal dd { margin-bottom: 0; }
}

.legal ul { padding-left: 1.25rem; }

/* Sitemap */
.sitemap-list,
.sitemap-list ul {
  list-style: none;
  padding-left: 0;
}

.sitemap-list ul {
  margin: 0.5rem 0 0.5rem 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-border);
}

.sitemap-list li { margin-bottom: 0.5rem; }

.sitemap-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

/* -------- 14. Footer -------- */
.site-footer {
  padding: 3.5rem 0 0;
  background: #1f170f;
  color: var(--color-on-dark-muted);
  font-size: 0.95rem;
}

.site-footer h2 {
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-oak-300);
}

.site-footer a {
  color: var(--color-on-dark-muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--color-white); }

.site-footer .brand,
.site-footer .brand:hover { color: var(--color-white); }

.site-footer .brand-top { color: var(--color-oak-300); }

.footer-tagline {
  margin: 1.25rem 0 0;
  max-width: 22rem;
}

.footer-links,
.footer-contact {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li { margin-bottom: 0.45rem; }

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.footer-contact .icon { color: var(--color-oak-300); margin-top: 0.25rem; }
.footer-contact address { margin: 0; }

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(217, 176, 119, 0.18);
  font-size: 0.85rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* -------- 15. Scroll to top -------- */
.scroll-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1030;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition), background-color var(--transition);
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.scroll-top:hover { background: var(--color-accent-hover); }
.scroll-top .icon { width: 1.4rem; height: 1.4rem; }

@media (min-width: 768px) {
  .scroll-top { right: 1.5rem; bottom: 1.5rem; }
}

/* -------- 16. 404 -------- */
.error-code {
  font-family: var(--font-heading);
  font-size: clamp(5rem, 3rem + 10vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--color-oak-300);
}

/* -------- 17. Reduced motion -------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------- 18. Print -------- */
@media print {
  .topbar,
  .site-header,
  .cta-band,
  .scroll-top,
  .lightbox,
  .hero-bg { display: none !important; }

  .hero,
  .page-header { background: none; color: #000; padding: 1rem 0; }
  .hero::before,
  .page-header::before { display: none; }
  .hero h1,
  .page-header h1 { color: #000; }
  .site-footer { background: none; color: #000; }
}

.narrow { max-width: 32rem; }
