/* ==========================================================================
   Wayfarer — rugged outdoor theme + CMS
   ========================================================================== */

:root {
  --bg: #f6f1e4;
  --bg-alt: #ece3cd;
  --bg-dark: #1e2b23;
  --bg-dark-alt: #263a2e;
  --border: #ddd1b0;
  --text: #22271f;
  --text-dim: #5c5b4c;
  --text-dimmer: #8b8873;
  --accent: #c1592c;
  --accent-bright: #d97a3f;
  --accent-2: #3f5f4f;
  --accent-text: #fff8ec;

  --container-width: 1160px;
  --radius: 6px;
  --radius-lg: 4px;
  --font-heading: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; font-weight: 700; }
em { font-style: italic; color: var(--accent); }

.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }

.section { padding: 96px 0; }
.section-dark { background: var(--bg-dark); color: var(--accent-text); }
.section-dark .eyebrow { color: var(--accent-bright); }
.section-dark .lead { color: rgba(255, 248, 236, 0.75); }
.section-dark p { color: rgba(255, 248, 236, 0.75); }

.section-head { text-align: center; max-width: 620px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); margin-top: 8px; }

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead { font-size: 18px; color: var(--text-dim); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }

.section-dark .btn-ghost, .hero .btn-ghost { color: var(--accent-text); border-color: var(--accent-text); }
.section-dark .btn-ghost:hover, .hero .btn-ghost:hover { background: var(--accent-text); color: var(--bg-dark); }

.btn-lg { padding: 17px 32px; font-size: 15px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 22px 0;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 248, 236, 0.1);
}

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

.logo { font-family: var(--font-heading); font-size: 19px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-text); }
.logo span { color: var(--accent-bright); }

.main-nav ul { display: flex; gap: 34px; }
.main-nav a {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 248, 236, 0.75);
  padding-bottom: 4px;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 0;
  background: var(--accent-bright);
  transition: width 0.25s ease;
}
.main-nav a:hover { color: var(--accent-text); }
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 248, 236, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span { display: block; width: 16px; height: 2px; margin: 0 auto; background: var(--accent-text); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.hero {
  position: relative;
  padding: 120px 0 0;
  text-align: center;
  /* Plain fallback gradient when no hero photo has been uploaded — index.php adds
     an inline background-image (this same gradient layered with the photo URL)
     once one is set, so background-blend-mode below applies either way. */
  background-image: linear-gradient(180deg, rgba(30, 43, 35, 0.35) 0%, rgba(30, 43, 35, 0.55) 40%, var(--bg-dark) 97%);
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  background-blend-mode: multiply, normal;
  background-color: var(--bg-dark);
  color: var(--accent-text);
  overflow: hidden;
}

.hero-inner { max-width: 780px; margin: 0 auto; padding-bottom: 130px; position: relative; z-index: 1; }
.hero .eyebrow { color: var(--accent-bright); margin-bottom: 22px; display: inline-block; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.hero h1 { font-size: clamp(32px, 5vw, 50px); margin-bottom: 22px; color: var(--accent-text); text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); }
.hero p.lead { font-size: 18px; color: rgba(255, 248, 236, 0.85); max-width: 560px; margin: 0 auto 36px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-ridge {
  position: relative;
  height: 90px;
  background: var(--bg);
  clip-path: polygon(0% 100%, 0% 40%, 8% 55%, 18% 20%, 28% 60%, 38% 30%, 50% 65%, 62% 25%, 74% 58%, 86% 15%, 100% 50%, 100% 100%);
}

/* Trip cards
   ========================================================================== */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.trip-card { background: #fff; border: 1px solid var(--border); overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.trip-card:hover { transform: translateY(-5px); box-shadow: 0 18px 32px -18px rgba(30, 43, 35, 0.35); }

.trip-thumb { height: 170px; position: relative; }
.trip-thumb-1 { background: linear-gradient(135deg, #3f5f4f, #1e2b23); }
.trip-thumb-2 { background: linear-gradient(135deg, #c1592c, #7a3016); }
.trip-thumb-3 { background: linear-gradient(135deg, #8b8873, #5c5b4c); }

.trip-thumb-photo { padding: 0; }
.trip-thumb-photo img { width: 100%; height: 100%; object-fit: cover; }

.trip-tag {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}

.trip-body { padding: 22px 22px 26px; }
.trip-body h3 { font-size: 19px; margin-bottom: 8px; }
.trip-body p { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; }
.trip-meta { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }

/* Approach
   ========================================================================== */

.approach-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }

.approach-points { display: flex; flex-direction: column; gap: 28px; }
.approach-point { display: flex; gap: 18px; }
.approach-number { font-family: var(--font-heading); font-size: 26px; color: var(--accent-bright); flex-shrink: 0; }
.approach-point h3 { font-size: 18px; margin-bottom: 6px; color: var(--accent-text); }
.approach-point p { font-size: 14px; }

/* Guides
   ========================================================================== */

.guide-card { text-align: center; padding: 20px; }
.guide-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--bg-dark));
  color: var(--accent-text);
  font-family: var(--font-heading);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  overflow: hidden;
}
.guide-avatar-photo { background: none; }
.guide-avatar-photo img { width: 100%; height: 100%; object-fit: cover; }
.guide-card h3 { font-size: 18px; margin-bottom: 6px; }
.guide-role { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

/* Trip highlight video
   ========================================================================== */

.trip-video { margin-top: 56px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }

/* CTA
   ========================================================================== */

.cta-banner { text-align: center; max-width: 640px; margin: 0 auto; }
.cta-banner h2 { font-size: clamp(28px, 4vw, 38px); margin: 10px 0 14px; }
.cta-banner p { margin-bottom: 30px; }

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

.site-footer { background: var(--bg-dark); padding: 32px 0; text-align: center; }
.footer-bottom p { color: rgba(255, 248, 236, 0.5); font-size: 13px; }
.footer-admin-link { margin-top: 4px; }
.footer-admin-link a { text-decoration: underline; opacity: 0.7; }
.footer-admin-link a:hover { opacity: 1; }

/* Responsive video/embed utility — used anywhere a cms_video() field renders */

.media-embed-16x9 { position: relative; padding-top: 56.25%; background: #000; }
.media-embed-16x9 iframe,
.media-embed-16x9 video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .approach-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 768px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(255, 248, 236, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .main-nav.is-open { max-height: 320px; }
  .main-nav ul { flex-direction: column; padding: 8px 24px 20px; gap: 4px; }
  .main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(255, 248, 236, 0.1); }
  .header-actions .btn { display: none; }
  .nav-toggle { display: flex; }
}

/* ==========================================================================
   Admin / install / auth — shared across every Deadmojo CMS-driven template.
   Uses var() fallbacks so it works whether or not the theme above defines
   --bg-card / --radius-lg.
   ========================================================================== */

.flash {
  margin: 16px auto 0;
  padding: 12px 18px;
  border-radius: var(--radius, 8px);
  font-size: 14px;
}
.flash-success { background: rgba(80, 200, 120, 0.12); border: 1px solid rgba(80, 200, 120, 0.35); color: #4fbd7a; }
.flash-error { background: rgba(220, 80, 70, 0.12); border: 1px solid rgba(220, 80, 70, 0.35); color: #e2685c; }

.demo-banner {
  background: var(--accent);
  color: var(--accent-text, #fff);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  position: relative;
  z-index: 200;
}
.demo-banner a { text-decoration: underline; }

.auth-section { padding: 64px 0 80px; display: flex; justify-content: center; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card, var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, var(--radius, 12px));
  padding: 36px 32px;
}

.auth-card h1 { font-size: 24px; margin-bottom: 6px; text-align: center; }
.auth-subtext { color: var(--text-dim); font-size: 13px; text-align: center; margin-bottom: 24px; }
.demo-login-hint { font-size: 13px; color: var(--text-dim); background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius, 8px); padding: 10px 14px; margin-bottom: 20px; }

.form-errors { background: rgba(220, 80, 70, 0.1); border: 1px solid rgba(220, 80, 70, 0.3); border-radius: var(--radius, 8px); padding: 14px 18px; margin-bottom: 20px; font-size: 14px; color: #e2685c; }
.form-errors ul { list-style: disc; padding-left: 18px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text-dim); }
.field-help { font-size: 12px; color: var(--text-dimmer); margin: -2px 0 8px; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.form-group textarea { resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--accent); }

.admin-video-url { margin-top: 8px; }

.admin-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); margin: 8px 0; }
.admin-checkbox input { width: auto; }

.admin-media-preview { margin-bottom: 10px; }
.admin-media-preview img { max-width: 220px; max-height: 140px; object-fit: cover; border-radius: var(--radius, 8px); border: 1px solid var(--border); }
.admin-media-preview video { max-width: 320px; border-radius: var(--radius, 8px); border: 1px solid var(--border); }

.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; align-items: flex-start; }

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--bg-card, var(--bg-alt));
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
}
.admin-sidebar .logo { margin-bottom: 28px; font-size: 18px; display: block; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  padding: 10px 12px;
  border-radius: var(--radius, 8px);
  font-size: 14px;
  color: var(--text-dim);
}
.admin-nav a:hover { background: var(--bg-alt); text-decoration: none; }
.admin-nav a.is-active { background: rgba(255, 255, 255, 0.06); color: var(--accent); }

.admin-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.admin-sidebar-footer a { color: var(--text-dim); }
.admin-sidebar-footer a:hover { color: var(--accent); }

.admin-main { flex: 1; padding: 40px; max-width: 900px; }
.admin-main h1 { font-size: 26px; margin-bottom: 6px; }
.admin-subtext { color: var(--text-dim); margin-bottom: 28px; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.admin-stat { background: var(--bg-card, var(--bg-alt)); border: 1px solid var(--border); border-radius: var(--radius-lg, var(--radius, 12px)); padding: 20px; }
.admin-stat-value { display: block; font-size: 28px; font-weight: 800; margin-bottom: 4px; color: var(--accent); }
.admin-stat-label { font-size: 12px; color: var(--text-dim); }

.admin-quicklinks { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-form { max-width: 640px; }
.admin-form-wide { max-width: 720px; }

.admin-fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg, var(--radius, 12px)); padding: 24px; margin-bottom: 24px; }
.admin-fieldset legend { padding: 0 8px; font-size: 15px; font-weight: 700; color: var(--accent); }

.install-body { display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; background: var(--bg); }
.install-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card, var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, var(--radius, 12px));
  padding: 36px 32px;
}
.install-card h1 { font-size: 24px; margin-bottom: 24px; }
.install-card h2 { font-size: 16px; margin: 24px 0 12px; }
.install-card p { margin-bottom: 12px; font-size: 14px; color: var(--text-dim); }

.install-checklist { list-style: none; font-size: 14px; }
.install-checklist li { padding: 6px 0; }
.install-checklist .is-ok { color: #4fbd7a; }
.install-checklist .is-fail { color: #e2685c; font-weight: 600; }

.install-error { background: rgba(220, 80, 70, 0.1); border: 1px solid rgba(220, 80, 70, 0.3); border-radius: var(--radius, 8px); padding: 14px 18px; margin: 14px 0; font-size: 14px; }
.install-error ul { list-style: disc; padding-left: 18px; margin: 0; }
.install-success { color: #4fbd7a; font-weight: 600; font-size: 15px; }
.install-hint { font-size: 12px; color: var(--text-dimmer); }

@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; min-height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-footer { flex-direction: row; border-top: none; padding-top: 0; margin-left: auto; }
  .admin-main { padding: 24px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}
