/* =========================================================================
   Weißes Rössl Floß – Base Stylesheet
   Shared design tokens, reset, typography, layout primitives, header,
   footer, hero-small, breadcrumb, buttons, forms, scroll-reveal.
   ========================================================================= */

@layer reset, tokens, base, components, utilities, motion, responsive;

/* ---------- Design Tokens ---------- */
@layer tokens {
  :root {
    --gold: #c8a97e;
    --gold-light: #e8d5b7;
    --gold-dark: #a08050;
    --black: #0a0a0a;
    --black-soft: #141414;
    --black-lift: #1a1a1a;
    --white: #ffffff;
    --offwhite: #f8f6f3;
    --cream: #f0ece6;
    --text: #333333;
    --text-light: #888888;
    --text-muted: #aaaaaa;
    --success: #4a7c59;
    --overlay: rgba(10, 10, 10, 0.55);
    --overlay-deep: rgba(10, 10, 10, 0.75);
    --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

    --container-w: 1400px;
    --container-px: 40px;
  }
}

/* ---------- Reset ---------- */
@layer reset {
  *,
  *::before,
  *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
  }
  img,
  svg,
  video,
  iframe {
    display: block;
    max-width: 100%;
  }
  button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
  }
  ul {
    list-style: none;
  }
  a {
    color: inherit;
  }
}

/* ---------- Base typography & body ---------- */
@layer base {
  body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }

  ::-webkit-scrollbar {
    width: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--black);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
  }
  ::selection {
    background: var(--gold);
    color: var(--white);
  }

  /* Icon helper – generic shrink-protect for icons in flex rows.
     Sizing of <i class="fas …"> Font Awesome glyphs is driven by font-size
     of the parent, so we only protect against flexbox squash here. */
  .icon { flex-shrink: 0; }

  /* Skip link for a11y */
  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--black);
    color: var(--gold);
    padding: 12px 20px;
    z-index: 9999;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
  }
  .skip-link:focus {
    left: 0;
  }
}

/* ---------- Layout primitives ---------- */
@layer base {
  .container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--container-px);
  }
  .section {
    padding: 100px 0;
  }
  .section-header {
    text-align: center;
    margin-bottom: 70px;
  }
  .section-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--gold);
    margin-bottom: 18px;
    display: inline-block;
  }
  .section-title {
    font-size: clamp(32px, 4vw, 52px);
    color: var(--black);
    margin-bottom: 20px;
  }
  .section-subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
  }
}

/* ---------- Header / Nav ---------- */
@layer components {
  .header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    transition: background 0.5s var(--transition-smooth),
      box-shadow 0.5s var(--transition-smooth);
    background: transparent;
  }
  .header.scrolled,
  .header.solid {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
  }
  .header-inner {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--container-px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    transition: height 0.5s var(--transition-smooth);
  }
  .header.scrolled .header-inner {
    height: 65px;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    position: relative;
  }
  .logo-mark {
    width: 44px;
    height: 44px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    transition: transform 0.4s var(--transition-smooth);
  }
  .logo-mark::before {
    content: '';
    position: absolute;
    inset: -6px;
    border: 1px solid rgba(200, 169, 126, 0.3);
    border-radius: 50%;
    animation: logoPulse 3s ease-in-out infinite;
  }
  .logo-mark .icon {
    font-size: 22px;
    color: var(--gold);
    transition: transform 0.4s var(--transition-smooth);
  }
  .logo:hover .logo-mark .icon {
    transform: rotate(-15deg);
  }
  .logo-text {
    color: var(--white);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
  }
  .logo-text span {
    display: block;
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 3px;
  }

  .nav {
    display: flex;
    gap: 40px;
    align-items: center;
  }
  .nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s;
    opacity: 0.85;
  }
  .nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: var(--gold);
    transition: width 0.4s var(--transition-smooth);
    transform: translateX(-50%);
  }
  .nav a:hover,
  .nav a[aria-current='page'] {
    color: var(--gold);
    opacity: 1;
  }
  .nav a:hover::after,
  .nav a[aria-current='page']::after {
    width: 100%;
  }
  .nav-cta {
    padding: 10px 28px;
    border: 1.5px solid var(--gold);
    color: var(--gold);
    border-radius: 2px;
  }
  .nav-cta::after {
    display: none;
  }
  .nav-cta:hover {
    background: var(--gold);
    color: var(--black);
  }

  .mobile-toggle {
    display: none;
    color: var(--white);
    font-size: 24px;
    z-index: 1001;
    padding: 8px;
  }
}

/* ---------- Breadcrumb ---------- */
@layer components {
  .breadcrumb {
    background: var(--black-soft);
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 80px;            /* clear the fixed header */
  }
  .breadcrumb-inner {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--container-px);
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  .breadcrumb-inner a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.3s;
  }
  .breadcrumb-inner a:hover {
    color: var(--white);
  }
  .breadcrumb-sep {
    margin: 0 10px;
    color: var(--text-muted);
  }
  .breadcrumb-current {
    color: var(--white);
  }
}

/* ---------- Hero-small (subpage hero) ---------- */
@layer components {
  .hero-small {
    height: 45vh;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
  }
  .hero-small-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    scale: 1.1;
    transition: scale 8s ease;
    will-change: scale, translate;
  }
  .hero-small:hover .hero-small-bg {
    scale: 1;
  }
  .hero-small-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-deep);
  }
  .hero-small-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    padding: 0 20px;
  }
  .hero-small-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--gold);
    margin-bottom: 20px;
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid rgba(200, 169, 126, 0.4);
    border-radius: 2px;
  }
  .hero-small-title,
  .hero-small h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 600;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
  .hero-small-sub {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    opacity: 0.8;
    letter-spacing: 3px;
    margin-top: 10px;
  }
}

/* ---------- Buttons ---------- */
@layer components {
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: var(--gold);
    color: var(--black);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: 1.5px solid var(--gold);
    transition: color 0.5s var(--transition-smooth);
    cursor: pointer;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
  }
  .btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--black);
    transform: translateX(-101%);
    transition: transform 0.5s var(--transition-smooth);
    z-index: 0;
  }
  .btn:hover::before {
    transform: translateX(0);
  }
  .btn > * {
    position: relative;
    z-index: 1;
    transition: color 0.5s;
  }
  .btn:hover {
    color: var(--gold);
  }
  .btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
  }
  .btn-outline::before {
    background: var(--gold);
  }
  .btn-outline:hover {
    color: var(--black);
  }
  .btn-dark {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
  }
  .btn-dark::before {
    background: var(--gold);
  }
  .btn-dark:hover {
    color: var(--black);
  }
  .btn-full {
    width: 100%;
    justify-content: center;
  }
  .btn-gold {
  color: var(--gold);
  border-color: var(--gold);
  }
  .btn-gold:hover {
  background: var(--gold);
  color: var(--black);
  }
}

/* ---------- Forms ---------- */
@layer components {
  .form-group {
    margin-bottom: 22px;
  }
  .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--gold);
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    border-radius: 2px;
  }
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
  }
  .form-group input::placeholder,
  .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
  }
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  /* Light form variant on offwhite background */
  .form--light .form-group label {
    color: var(--black);
  }
  .form--light .form-group input,
  .form--light .form-group select,
  .form--light .form-group textarea {
    background: var(--white);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
  }
  .form--light .form-group input::placeholder,
  .form--light .form-group textarea::placeholder {
    color: #aaa;
  }
  .form--light .form-group input:focus,
  .form--light .form-group select:focus,
  .form--light .form-group textarea:focus {
    background: var(--white);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 169, 126, 0.1);
  }
}

/* ---------- Footer ---------- */
@layer components {
  .footer {
    background: var(--black);
    color: var(--white);
    padding: 80px 0 30px;
    position: relative;
  }
  .footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.3;
  }
  .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 60px;
  }
  .footer-brand .logo-text {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--white);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .footer-brand .logo-text .icon {
    font-size: 22px;
    color: var(--gold);
  }
  .footer-brand p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
    max-width: 320px;
  }
  .footer-social {
    display: flex;
    gap: 12px;
  }
  .footer-social a {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: grid;
    place-items: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.4s var(--transition-smooth),
      color 0.4s var(--transition-smooth),
      border-color 0.4s var(--transition-smooth),
      transform 0.4s var(--transition-smooth);
    border-radius: 50%;
    font-size: 16px;
  }
  .footer-social a:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--black);
    transform: translateY(-3px);
  }
  .footer-links h4 {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 25px;
    color: var(--gold);
  }
  .footer-links li {
    margin-bottom: 12px;
  }
  .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
  }
  .footer-links a:hover {
    color: var(--gold);
    transform: translateX(5px);
  }
  .footer-contact p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .footer-contact .icon {
    color: var(--gold);
    font-size: 14px;
    width: 20px;
  }
  .footer-contact a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
  }
  .footer-contact a:hover {
    color: var(--gold);
  }
  .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 1px;
  }
  .footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
    margin-left: 25px;
  }
  .footer-bottom a:hover {
    color: var(--gold);
  }
}

/* ---------- Generic CTA section (shared shell, page sets bg) ---------- */
@layer components {
  .cta {
    color: var(--white);
    text-align: center;
    padding: 100px 0;
    position: relative;
    background:
      linear-gradient(var(--overlay), var(--overlay)),
      var(--cta-bg, none) center/cover fixed;
  }
  .cta h2 {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 20px;
    color: var(--white);
  }
  .cta h2 em {
    font-style: italic;
    color: var(--gold-light);
  }
  .cta p {
    max-width: 600px;
    margin: 0 auto 35px;
    opacity: 0.8;
    font-size: 16px;
    line-height: 1.7;
  }
  .cta-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
  }
}

/* ---------- Keyframes ---------- */
@layer motion {
  @keyframes logoPulse {
    0%,
    100% {
      transform: scale(1);
      opacity: 1;
    }
    50% {
      transform: scale(1.1);
      opacity: 0.5;
    }
  }
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
  }

  /* Scroll reveal */
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 0;
    transition: opacity 1s var(--transition-smooth),
      transform 1s var(--transition-smooth);
    will-change: opacity, transform;
  }
  .reveal       { transform: translateY(50px); }
  .reveal-left  { transform: translateX(-60px); }
  .reveal-right { transform: translateX(60px); }
  .reveal-scale { transform: scale(0.9); }

  .reveal.active,
  .reveal-left.active,
  .reveal-right.active,
  .reveal-scale.active {
    opacity: 1;
    transform: none;
  }

  .stagger-1 { transition-delay: 0.1s; }
  .stagger-2 { transition-delay: 0.2s; }
  .stagger-3 { transition-delay: 0.3s; }
  .stagger-4 { transition-delay: 0.4s; }

  /* Respect user preference */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
      scroll-behavior: auto !important;
    }
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
      opacity: 1 !important;
      transform: none !important;
    }
    .hero-small-bg,
    .hero-bg,
    .seasonal-bg,
    .rooms-hero-bg,
    .contact-hero-bg {
      transform: none !important;
      translate: none !important;
      scale: 1 !important;
    }
  }
}

/* ---------- Responsive ---------- */
@layer responsive {
  @media (max-width: 1024px) {
    :root {
      --container-px: 25px;
    }
    .footer-grid {
      grid-template-columns: 1fr 1fr;
    }
  }
  @media (max-width: 768px) {
    .nav {
      display: none;
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100vh;
      background: var(--black-soft);
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 30px;
      padding: 20px;
    }
    .nav.active {
      display: flex;
    }
    .nav a {
      font-size: 18px;
      opacity: 1;
    }
    .mobile-toggle {
      display: inline-flex;
    }
    .footer-grid {
      grid-template-columns: 1fr;
      gap: 40px;
    }
    .footer-bottom {
      flex-direction: column;
      gap: 15px;
      text-align: center;
    }
    .section {
      padding: 70px 0;
    }
    .hero-small-title,
    .hero-small h1 {
      font-size: 32px;
    }
    .form-row {
      grid-template-columns: 1fr;
    }
  }
}

/* ---------- Utilities ---------- */
@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .text-gold { color: var(--gold); }
  .mt-30 { margin-top: 30px; }
  .mt-25 { margin-top: 25px; }
  .ml-15 { margin-left: 15px; }
  /* Defer offscreen sections paint */
  .cv-auto {
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
  }
}
