/*
Theme Name: Illia & Florence Legacy
Theme URI: https://example.com
Author: Illia & Florence
Description: A clean family, wedding, and mission-focused WordPress theme for Illia & Florence. Designed to pair with Polylang for English, French, and Ukrainian.
Version: 1.1.0
License: GPLv2 or later
Text Domain: illia-florence-legacy
*/

/* =========================
   Base Theme Variables
========================= */

:root {
  --if-bg: #fffaf4;
  --if-surface: #ffffff;
  --if-surface-soft: #fff3e6;
  --if-text: #241f1b;
  --if-muted: #6f6258;
  --if-primary: #8a5a44;
  --if-primary-dark: #5f3b2d;
  --if-accent: #d6a86f;
  --if-border: #eadfd3;
  --if-radius: 24px;
  --if-shadow: 0 18px 50px rgba(43, 37, 32, 0.1);
}

/* =========================
   Palettes
========================= */

body[data-palette="bright"] {
  --if-bg: #fffaf4;
  --if-surface: #ffffff;
  --if-surface-soft: #fff0df;
  --if-text: #241f1b;
  --if-muted: #6f6258;
  --if-primary: #8a5a44;
  --if-primary-dark: #5f3b2d;
  --if-accent: #d6a86f;
  --if-border: #eadfd3;
  --if-shadow: 0 18px 50px rgba(43, 37, 32, 0.1);
}

body[data-palette="dark"] {
  --if-bg: #0f1115;
  --if-surface: #191d24;
  --if-surface-soft: #222936;
  --if-text: #f6efe7;
  --if-muted: #c7b8aa;
  --if-primary: #e4b17c;
  --if-primary-dark: #ffd4a8;
  --if-accent: #c98552;
  --if-border: #333b48;
  --if-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

body[data-palette="fall"] {
  --if-bg: #fff1df;
  --if-surface: #fffaf2;
  --if-surface-soft: #ffe0bd;
  --if-text: #2d190e;
  --if-muted: #7b563d;
  --if-primary: #a34e1f;
  --if-primary-dark: #642a12;
  --if-accent: #df852f;
  --if-border: #efcba5;
  --if-shadow: 0 18px 50px rgba(116, 55, 18, 0.16);
}

body[data-palette="winter"] {
  --if-bg: #eef7fb;
  --if-surface: #ffffff;
  --if-surface-soft: #dceff8;
  --if-text: #182936;
  --if-muted: #607483;
  --if-primary: #326c91;
  --if-primary-dark: #1d425f;
  --if-accent: #9fd0ec;
  --if-border: #cfe5f0;
  --if-shadow: 0 18px 50px rgba(36, 89, 122, 0.14);
}

body[data-palette="spring"] {
  --if-bg: #f5fbef;
  --if-surface: #ffffff;
  --if-surface-soft: #e4f3d5;
  --if-text: #203026;
  --if-muted: #64765d;
  --if-primary: #5b8247;
  --if-primary-dark: #324d28;
  --if-accent: #b7d97d;
  --if-border: #dbeacb;
  --if-shadow: 0 18px 50px rgba(73, 111, 53, 0.12);
}

body[data-palette="summer"] {
  --if-bg: #fff9dc;
  --if-surface: #ffffff;
  --if-surface-soft: #ffefad;
  --if-text: #20323a;
  --if-muted: #69705e;
  --if-primary: #247f91;
  --if-primary-dark: #155564;
  --if-accent: #f4bf3e;
  --if-border: #eadf9f;
  --if-shadow: 0 18px 50px rgba(36, 127, 145, 0.14);
}

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

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, var(--if-surface-soft), transparent 34rem),
    var(--if-bg);
  color: var(--if-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

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

a {
  color: var(--if-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--if-primary-dark);
}

/* =========================
   Header
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--if-bg) 92%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--if-border);
}

.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
}

.site-title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.site-title a {
  color: var(--if-text);
  text-decoration: none;
}

.site-description {
  margin: 2px 0 0;
  color: var(--if-muted);
  font-size: 0.88rem;
}

/* =========================
   Navigation
========================= */

.primary-menu,
.primary-menu ul {
  display: flex;
  justify-content: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.primary-menu a {
  color: var(--if-text);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
}

.primary-menu a:hover {
  color: var(--if-primary);
}

/* =========================
   Dropdowns
========================= */

.language-dropdown,
.palette-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.language-dropdown select,
.language-dropdown .pll-switcher-select,
.palette-switcher select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 140px;
  max-width: 180px;
  padding: 9px 38px 9px 14px;
  border: 1px solid var(--if-border);
  border-radius: 999px;
  background: var(--if-surface);
  color: var(--if-primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(43, 37, 32, 0.06);
}

.language-dropdown::after,
.palette-switcher::after {
  content: "⌄";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-56%);
  pointer-events: none;
  color: var(--if-primary);
  font-size: 1rem;
  font-weight: 800;
}

.language-dropdown select:hover,
.palette-switcher select:hover {
  border-color: var(--if-accent);
}

.language-dropdown select:focus,
.palette-switcher select:focus {
  outline: none;
  border-color: var(--if-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--if-primary) 18%, transparent);
}

/* =========================
   Main Layout
========================= */

.site-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) 24px;
}

/* =========================
   Hero
========================= */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--if-radius) + 14px);
  padding: clamp(42px, 8vw, 96px);
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--if-accent) 48%, transparent), transparent 30%),
    radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--if-primary) 18%, transparent), transparent 28%),
    linear-gradient(135deg, var(--if-surface) 0%, var(--if-surface-soft) 100%);
  box-shadow: var(--if-shadow);
  border: 1px solid var(--if-border);
}

.hero-kicker {
  margin: 0 0 12px;
  color: var(--if-primary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 900;
}

.hero h1,
.entry-title {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.08em;
}

.hero p,
.entry-content p {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* =========================
   Buttons
========================= */

.button,
.wp-block-button__link {
  display: inline-block;
  border-radius: 999px;
  background: var(--if-primary);
  color: #fff !important;
  text-decoration: none;
  padding: 12px 20px;
  font-weight: 800;
  border: 1px solid var(--if-primary);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.wp-block-button__link:hover {
  transform: translateY(-1px);
  background: var(--if-primary-dark);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--if-primary) 24%, transparent);
}

.button.secondary {
  background: transparent;
  color: var(--if-primary) !important;
  border: 1px solid var(--if-primary);
}

.button.secondary:hover {
  color: #fff !important;
  background: var(--if-primary);
}

/* =========================
   Cards
========================= */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
}

.card {
  background: color-mix(in srgb, var(--if-surface) 92%, var(--if-surface-soft));
  border: 1px solid var(--if-border);
  border-radius: var(--if-radius);
  padding: 26px;
  box-shadow: var(--if-shadow);
}

.card h2,
.card h3 {
  margin-top: 0;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

/* =========================
   Page Content
========================= */

.entry-content {
  background: color-mix(in srgb, var(--if-surface) 94%, var(--if-surface-soft));
  border: 1px solid var(--if-border);
  border-radius: var(--if-radius);
  box-shadow: var(--if-shadow);
  padding: clamp(26px, 5vw, 58px);
}

.entry-content h2,
.entry-content h3 {
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

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

.site-footer {
  border-top: 1px solid var(--if-border);
  color: var(--if-muted);
  padding: 34px 24px;
  text-align: center;
}

/* =========================
   Dark Theme Tweaks
========================= */

body[data-palette="dark"] .site-header {
  background: rgba(15, 17, 21, 0.9);
}

body[data-palette="dark"] .language-dropdown select,
body[data-palette="dark"] .palette-switcher select {
  background: var(--if-surface);
  color: var(--if-text);
}

body[data-palette="dark"] .button {
  color: #14100d !important;
}

body[data-palette="dark"] .button.secondary {
  color: var(--if-primary-dark) !important;
}

body[data-palette="dark"] .button.secondary:hover {
  color: #14100d !important;
}

/* =========================
   Tablet
========================= */

@media (max-width: 980px) {
  .site-header-inner {
    grid-template-columns: 1fr auto auto;
  }

  .site-header-inner nav {
    grid-column: 1 / -1;
    order: 5;
  }

  .primary-menu,
  .primary-menu ul {
    justify-content: flex-start;
    gap: 14px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Mobile
========================= */

@media (max-width: 640px) {
  .site-header-inner {
    padding: 14px 18px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .site-description {
    font-size: 0.82rem;
  }

  .primary-menu,
  .primary-menu ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .primary-menu a {
    display: block;
    padding: 9px 12px;
    border: 1px solid var(--if-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--if-surface) 88%, transparent);
    text-align: center;
    font-size: 0.88rem;
  }

  .language-dropdown,
  .palette-switcher {
    width: 100%;
  }

  .language-dropdown select,
  .language-dropdown .pll-switcher-select,
  .palette-switcher select {
    width: 100%;
    max-width: none;
  }

  .site-main {
    padding: 28px 16px;
  }

  .hero {
    padding: 34px 24px;
    border-radius: 24px;
  }

  .hero h1,
  .entry-title {
    font-size: clamp(2.2rem, 15vw, 3.2rem);
    letter-spacing: -0.06em;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button,
  .wp-block-button__link {
    width: 100%;
    text-align: center;
  }

  .card,
  .entry-content {
    padding: 22px;
    border-radius: 20px;
  }
}

/* =========================
   Very Small Phones
========================= */

@media (max-width: 420px) {
  .primary-menu,
  .primary-menu ul {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 28px 20px;
  }
}