/* ============================================================
   ASTRA — Hotel & Restaurant Sunny Beach
   main.css — Design system, reset, typography, layout utilities
   ============================================================ */


/* ------------------------------------------------------------
   1. CUSTOM PROPERTIES (Design Tokens)
   ------------------------------------------------------------ */

:root {
    /* Brand colours */
    --color-sand: #F5F0E8; /* warm off-white — primary background */
    --color-sand-dark: #EDE6D6; /* subtle surface variant */
    --color-stone: #C0AECF; /* muted warm mid-tone — borders, dividers */
    --color-driftwood: #6B5C7A; /* body text on light, secondary accents */
    --color-earth: #2D1B3D; /* primary dark text */
    --color-sea: #6A7FD4; /* primary accent — sea teal */
    --color-sea-light: #8A9AE0; /* hover state for accent */
    --color-sea-dark: #4A5FA8; /* pressed / deep accent */
    --color-sky: #ECEAF8; /* very light tint of accent */
    --color-white: #FFFFFF;
    --color-error: #C0392B;
    --color-success: #27654A;
    --color-petal: #6A7FD4;
    --color-petal-light: #9BA8E8;
    --color-petal-dark: #4A5FA8;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif; /* headings — elegant, editorial */
    --font-body: 'Jost', sans-serif; /* body — clean, geometric, modern */
    --font-mono: 'JetBrains Mono', monospace;
    /* Type scale */
    --text-xs: 0.75rem; /*  12px */
    --text-sm: 0.875rem; /*  14px */
    --text-base: 1rem; /*  16px */
    --text-md: 1.125rem; /*  18px */
    --text-lg: 1.375rem; /*  22px */
    --text-xl: 1.75rem; /*  28px */
    --text-2xl: 2.25rem; /*  36px */
    --text-3xl: 3rem; /*  48px */
    --text-4xl: 4rem; /*  64px */
    /* Font weights */
    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semi: 600;
    /* Spacing scale */
    --space-1: 0.25rem; /*  4px */
    --space-2: 0.5rem; /*  8px */
    --space-3: 0.75rem; /* 12px */
    --space-4: 1rem; /* 16px */
    --space-5: 1.25rem; /* 20px */
    --space-6: 1.5rem; /* 24px */
    --space-8: 2rem; /* 32px */
    --space-10: 2.5rem; /* 40px */
    --space-12: 3rem; /* 48px */
    --space-16: 4rem; /* 64px */
    --space-20: 5rem; /* 80px */
    --space-24: 6rem; /* 96px */
    /* Layout */
    --container-max: 1200px;
    --container-narrow: 760px;
    --container-wide: 1400px;
    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --border-thin: 0.5px solid var(--color-stone);
    --border-base: 1px solid var(--color-stone);
    --border-accent: 1px solid var(--color-sea);
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(45, 27, 61, 0.08);
    --shadow-md: 0 4px 16px rgba(45, 27, 61, 0.10);
    --shadow-lg: 0 12px 40px rgba(45, 27, 61, 0.14);
    --shadow-xl: 0 24px 64px rgba(45, 27, 61, 0.18);
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    /* Z-index layers */
    --z-base: 0;
    --z-raised: 10;
    --z-overlay: 100;
    --z-modal: 200;
    --z-nav: 300;
    --z-toast: 400;
    /* Navbar height — used to offset scroll targets */
    --navbar-height: 72px;
}


/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: 1.7;
  color: var(--color-earth);
  background-color: var(--color-sand);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Offset anchor targets so navbar doesn't cover them */
[id] {
  scroll-margin-top: calc(var(--navbar-height) + var(--space-6));
}

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

img {
  object-fit: cover;
}

a {
  color: var(--color-sea);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-sea-light);
}

a:focus-visible {
  outline: 2px solid var(--color-sea);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Remove default focus ring; we add our own */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-sea);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Reduce motion for users who prefer it */
@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;
  }
}


/* ------------------------------------------------------------
   3. TYPOGRAPHY
   ------------------------------------------------------------ */

/* Google Fonts import — display + body */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Jost:wght@300;400;500;600&display=swap');

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-light);
  line-height: 1.2;
  color: var(--color-earth);
  letter-spacing: 0.01em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

/* Responsive heading scale */
@media (max-width: 640px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

p {
  max-width: 68ch; /* optimal reading line length */
}

p + p {
  margin-top: var(--space-4);
}

strong { font-weight: var(--weight-semi); }
em     { font-style: italic; }

small, .text-sm {
  font-size: var(--text-sm);
}

.text-xs    { font-size: var(--text-xs); }
.text-base  { font-size: var(--text-base); }
.text-md    { font-size: var(--text-md); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }

/* Eyebrow label — small uppercase label above section headings */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-sea);
  margin-bottom: var(--space-3);
}

/* Section heading block — eyebrow + h2 + optional subtitle */
.section-heading {
  margin-bottom: var(--space-12);
}

.section-heading p {
  font-size: var(--text-md);
  color: var(--color-driftwood);
  margin-top: var(--space-4);
}

/* Display italic — used in hero tagline */
.text-display-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--weight-light);
}

/* Muted text */
.text-muted { color: var(--color-driftwood); }

/* Text alignment utilities */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }


/* ------------------------------------------------------------
   4. LAYOUT & CONTAINERS
   ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

@media (max-width: 640px) {
  .container {
    padding-inline: var(--space-4);
  }
}

/* Section vertical rhythm */
.section {
  padding-block: var(--space-20);
}

.section--sm {
  padding-block: var(--space-12);
}

.section--lg {
  padding-block: var(--space-24);
}

/* Alternating section backgrounds */
.section--light { background-color: var(--color-sand); }
.section--white { background-color: var(--color-white); }
.section--tinted { background-color: var(--color-sand-dark); }
.section--dark {
  background-color: var(--color-earth);
  color: var(--color-sand);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--color-sand);
}

.section--dark .eyebrow {
  color: var(--color-stone);
}


/* ------------------------------------------------------------
   5. GRID SYSTEM
   ------------------------------------------------------------ */

/* Generic flexible grid */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Auto-fit responsive grids — no breakpoints needed */
.grid--auto-sm {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid--auto-md {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--auto-lg {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

/* Collapse to 1 column on mobile */
@media (max-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Flex utilities */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-2  { gap: var(--space-2); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }


/* ------------------------------------------------------------
   6. BUTTONS
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-fast),
    box-shadow var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary — solid sea teal */
.btn--primary {
  background-color: var(--color-sea);
  color: var(--color-white);
  border: 1px solid var(--color-sea);
}

.btn--primary:hover {
  background-color: var(--color-sea-dark);
  border-color: var(--color-sea-dark);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

/* Secondary — outlined */
.btn--secondary {
  background-color: transparent;
  color: var(--color-earth);
  border: 1px solid var(--color-stone);
}

.btn--secondary:hover {
  border-color: var(--color-earth);
  background-color: var(--color-sand-dark);
  color: var(--color-earth);
}

/* Ghost — for use on dark/image backgrounds */
.btn--ghost {
  background-color: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.btn--ghost:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--color-white);
  color: var(--color-white);
}

/* Sizes */
.btn--sm {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
}

/* Full width */
.btn--block {
  width: 100%;
}


/* ------------------------------------------------------------
   7. CARDS
   ------------------------------------------------------------ */

.card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: var(--border-thin);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card__body {
  padding: var(--space-6);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-light);
  margin-bottom: var(--space-2);
}

.card__text {
  font-size: var(--text-sm);
  color: var(--color-driftwood);
  line-height: 1.6;
}

.card__footer {
  padding: var(--space-4) var(--space-6);
  border-top: var(--border-thin);
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ------------------------------------------------------------
   8. FORMS
   ------------------------------------------------------------ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group + .form-group {
  margin-top: var(--space-5);
}

label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-earth);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-earth);
  background-color: var(--color-white);
  border: 1px solid var(--color-stone);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--color-driftwood);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-sea);
  box-shadow: 0 0 0 3px rgba(42, 107, 124, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-stone);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Honeypot — visually hidden, traps bots */
.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}

.form-success {
  font-size: var(--text-sm);
  color: var(--color-success);
  padding: var(--space-4);
  background-color: rgba(39, 101, 74, 0.08);
  border: 1px solid rgba(39, 101, 74, 0.25);
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
}


/* ------------------------------------------------------------
   9. IMAGES & MEDIA
   ------------------------------------------------------------ */

/* Aspect ratio wrappers */
.ratio-16-9  { aspect-ratio: 16 / 9; }
.ratio-4-3   { aspect-ratio: 4 / 3; }
.ratio-3-2   { aspect-ratio: 3 / 2; }
.ratio-1-1   { aspect-ratio: 1 / 1; }
.ratio-hero  { aspect-ratio: 21 / 9; }

.ratio-16-9 img,
.ratio-4-3 img,
.ratio-3-2 img,
.ratio-1-1 img,
.ratio-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lazy-loaded image fade-in */
img.lazy {
  opacity: 0;
  transition: opacity var(--transition-slow);
}

img.lazy.loaded {
  opacity: 1;
}


/* ------------------------------------------------------------
   10. DIVIDERS & DECORATIVE ELEMENTS
   ------------------------------------------------------------ */

.divider {
  border: none;
  border-top: var(--border-thin);
  margin-block: var(--space-8);
}

/* Ornamental line — centred decorative separator */
.ornament {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-block: var(--space-8);
  color: var(--color-stone);
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background-color: var(--color-stone);
}

.ornament__symbol {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: var(--weight-light);
  color: var(--color-stone);
  user-select: none;
}


/* ------------------------------------------------------------
   11. BADGES & TAGS
   ------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.badge--sea {
  background-color: var(--color-sky);
  color: var(--color-sea-dark);
}

.badge--earth {
  background-color: var(--color-sand-dark);
  color: var(--color-earth);
}

.badge--stone {
  background-color: transparent;
  color: var(--color-driftwood);
  border: 1px solid var(--color-stone);
}


/* ------------------------------------------------------------
   12. ACCESSIBILITY & UTILITIES
   ------------------------------------------------------------ */

/* Screen reader only — visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to main content link (keyboard navigation) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-sea);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Display utilities */
.hidden        { display: none !important; }
.visible       { visibility: visible; }
.invisible     { visibility: hidden; }
.block         { display: block; }
.inline-block  { display: inline-block; }
.inline-flex   { display: inline-flex; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }

/* Width / height */
.w-full  { width: 100%; }
.h-full  { height: 100%; }

/* Margin auto */
.mx-auto { margin-inline: auto; }

/* Spacing utilities (margin/padding) */
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.pt-4  { padding-top: var(--space-4); }
.pt-6  { padding-top: var(--space-6); }
.pb-4  { padding-bottom: var(--space-4); }
.pb-6  { padding-bottom: var(--space-6); }

/* Responsive visibility */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
  .hide-desktop { display: none !important; }
}


/* ------------------------------------------------------------
   13. ANIMATIONS
   ------------------------------------------------------------ */

/* Fade-in on scroll — add .animate-on-scroll to elements,
   JS IntersectionObserver adds .is-visible when in viewport  */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children — add delay via CSS custom property */
.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.animate-on-scroll:nth-child(4) { transition-delay: 240ms; }


/* ------------------------------------------------------------
   14. PRINT
   ------------------------------------------------------------ */

@media print {
  .no-print,
  astra-navbar,
  astra-footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #555;
  }
}
