/* =========================================================
   ThaiRaiSite — Modern CSS (no build tools required)
   Inspired by premium resort aesthetics.
   ========================================================= */

@layer base, components, utilities;

/* ---------------------------------------------------------
   Design Tokens
   --------------------------------------------------------- */
:root {
  /* Colors from Logo */
  --color-gold: #D4A017;
  --color-teal: #008B8B;
  --color-pink: #D1478D;
  --color-sand: #FDF6E3;
  --color-dark: #2F2F2F;
  --color-white: #FFFFFF;

  /* Semantic Colors */
  --bg-main: var(--color-sand);
  --text-main: var(--color-dark);
  --text-muted: #666666;
  --border-color: rgba(47, 47, 47, 0.1);

  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --font-accent: 'Marck Script', cursive;

  /* Sizes & Spacing */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
  --spacing-section: 5rem;
  --spacing-element: 1.5rem;
  --nav-height: 80px;
  --mobile-nav-height: 64px;
}

/* ---------------------------------------------------------
   Layer: Base
   --------------------------------------------------------- */
@layer base {
  :where(*, *::before, *::after) {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    /* Extra padding for mobile nav */
    padding-bottom: var(--mobile-nav-height);
  }

  @media (min-width: 768px) {
    body { padding-bottom: 0; }
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    color: var(--color-dark);
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.5rem; }

  @media (min-width: 768px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 3rem; }
    h3 { font-size: 1.75rem; }
  }

  a {
    color: var(--color-teal);
    text-decoration: none;
    transition: color 0.3s ease;
  }

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

  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }
}

/* ---------------------------------------------------------
   Layer: Components
   --------------------------------------------------------- */
@layer components {
  /* Layout */
  .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
  }

  .text-center { text-align: center; }

  /* Utilities within components */
  .bg-gold { background-color: var(--color-gold); }
  .bg-teal { background-color: var(--color-teal); }
  .bg-pink { background-color: var(--color-pink); }
  .bg-dark { background-color: var(--color-dark); }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
  }

  .btn-primary {
    background-color: var(--color-gold);
    color: var(--color-white);
  }

  .btn-primary:hover {
    background-color: #b3860f;
    color: var(--color-white);
    transform: translateY(-2px);
  }

  .btn-outline {
    background-color: transparent;
    border-color: var(--color-teal);
    color: var(--color-teal);
  }

  .btn-outline:hover {
    background-color: var(--color-teal);
    color: var(--color-white);
  }

  .btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
  }

  /* Header */
  .site-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: transparent;
    padding: 1rem 0;
  }

  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-white);
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }

  .desktop-nav {
    display: none;
  }

  .header-cta {
    display: none;
  }

  @media (min-width: 768px) {
    .desktop-nav { display: block; }
    .desktop-nav ul {
      display: flex;
      gap: 2rem;
    }
    .desktop-nav a {
      color: var(--color-white);
      font-family: var(--font-heading);
      font-weight: 600;
      text-transform: uppercase;
      font-size: 0.9rem;
      text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
    .desktop-nav a:hover { color: var(--color-gold); }
    .header-cta { display: inline-flex; }
  }

  /* Hero Section */
  .hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('https://images.unsplash.com/photo-1552465011-b4e21bf6e79a?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    padding-top: var(--nav-height);
  }

  .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
  }

  .hero-content {
    position: relative;
    z-index: 10;
    color: var(--color-white);
  }

  .hero-subtitle {
    font-family: var(--font-accent);
    font-size: 2.5rem;
    color: var(--color-gold);
    display: block;
    margin-bottom: -10px;
    transform: rotate(-5deg);
  }

  @media (min-width: 768px) {
    .hero-subtitle { font-size: 3.5rem; }
  }

  .hero h1 { color: var(--color-white); text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
  
  .hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  }

  /* Section Headers */
  .section-header {
    text-align: center;
    margin-bottom: 3rem;
  }

  .section-subtitle {
    font-family: var(--font-accent);
    font-size: 2rem;
    color: var(--color-teal);
    display: block;
    margin-bottom: 0.5rem;
  }

  /* Categories Section */
  .categories-section {
    padding: var(--spacing-section) 0 2rem;
    margin-top: -80px;
    position: relative;
    z-index: 20;
  }

  .categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
  }

  @media (min-width: 768px) {
    .categories-grid { grid-template-columns: repeat(4, 1fr); }
  }

  .category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .category-card .icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
  }

  .category-card:hover .icon-wrap { transform: scale(1.1); }
  
  .category-card span {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-dark);
  }

  /* Tours Section */
  .tours-section {
    padding: 3rem 0 var(--spacing-section);
  }

  .tours-grid {
    display: grid;
    gap: 2rem;
  }

  @media (min-width: 768px) {
    .tours-grid { grid-template-columns: repeat(2, 1fr); }
  }

  @media (min-width: 1024px) {
    .tours-grid { grid-template-columns: repeat(3, 1fr); }
  }

  .tour-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
  }

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

  .tour-card-image-wrap {
    position: relative;
    padding-top: 66%; /* 3:2 aspect ratio */
  }

  .tour-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .tour-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-pink);
    color: var(--color-white);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
  }

  .tour-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }

  .tour-card__title { margin-bottom: 0.5rem; }

  .tour-card-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .tour-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .tour-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
  }

  .tour-card__price {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-teal);
    margin: 0;
  }

  /* Benefits Section */
  .benefits-section {
    padding: var(--spacing-section) 0;
    background-color: var(--color-white);
  }

  .benefits-grid {
    display: grid;
    gap: 2rem;
  }

  @media (min-width: 768px) {
    .benefits-grid { grid-template-columns: repeat(3, 1fr); }
  }

  .benefit-card {
    text-align: center;
    padding: 2rem;
  }

  .benefit-card .icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transform: rotate(-5deg);
  }

  /* Footer */
  .site-footer {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 4rem 0 2rem;
  }

  .footer-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
  }

  @media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr; }
  }

  .footer-brand p {
    color: #999;
    max-width: 300px;
    margin-top: 1rem;
  }

  .footer-links h3 { color: var(--color-white); }
  .footer-links p { color: #999; margin-bottom: 0.5rem; }

  .footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #999;
    font-size: 0.9rem;
  }

  /* Mobile Bottom Nav */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-nav-height);
    background: var(--color-white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
  }

  @media (min-width: 768px) {
    .mobile-bottom-nav { display: none; }
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
  }

  .nav-item.active, .nav-item:hover {
    color: var(--color-teal);
  }
}

@layer utilities {}
