/* =============================
   Warm & Inviting Theme Styles
   ============================= */

/* Color Palette Variables */
:root {
  --tiger-flame: #f46036; /* primary accent */
  --dusty-denim: #5b85aa; /* secondary accent */
  --twilight-indigo: #414770; /* headings/nav */
  --dark-amethyst: #372248; /* deep accents */
  --midnight-violet: #171123; /* body text/footer */
  --bg-peach: #fff8f5; /* warm background */
  --radius-sm: 15px;
  --radius-md: 20px;
  --radius-lg: 40px;
  --shadow-soft: 0 4px 15px rgba(0,0,0,0.08);
  --shadow-soft-hover: 0 8px 22px rgba(0,0,0,0.12);
  --transition: 0.25s ease;
}

/* Reset & Base */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI','Roboto',sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--midnight-violet);
  background: #fff;
}
html, body { min-height: 100%; overscroll-behavior-y: none; }
body.has-bg-peach { background: var(--bg-peach); }
/* Make homepage body transparent so background layer shows */
body.home { background: transparent; position: relative; }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
a { color: var(--tiger-flame); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--dark-amethyst); }

/* Accessibility Utilities */
.visually-hidden { position: absolute !important; clip: rect(1px,1px,1px,1px); padding: 0 !important; border: 0 !important; height: 1px !important; width: 1px !important; overflow: hidden; }
/* Skip link stays hidden visually and to pointer until keyboard focus */
a.skip-link { position: fixed; top: .5rem; left: .5rem; background: var(--twilight-indigo); color: #fff; padding: .75rem 1rem; z-index: 100; border-radius: var(--radius-sm); transform: translateY(-200%); transition: transform var(--transition); pointer-events: none; }
a.skip-link:focus { transform: translateY(0); pointer-events: auto; }

/* Layout Wrappers */
.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }
main { padding-bottom: 4rem; }

/* Sticky Navigation */
header { position: sticky; top: 0; z-index: 50; background: rgba(255,248,245,0.9); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.site-nav-wrap { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 2.5rem; padding: .85rem 1rem; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2.5rem; }
nav a { font-size: 1rem; font-weight: 500; color: var(--twilight-indigo); padding: .5rem .6rem; border-radius: var(--radius-sm); }
nav a[aria-current="page"] { color: var(--tiger-flame); font-weight: 600; }
nav a:hover, nav a:focus-visible { color: var(--tiger-flame); background: rgba(244,96,54,0.08); }

/* Mobile Nav Toggle (kept minimal) */
.menu-toggle { background: #fff; border: 2px solid var(--twilight-indigo); border-radius: var(--radius-sm); padding: .5rem .75rem; font: inherit; cursor: pointer; display: none; color: var(--twilight-indigo); }
.menu-toggle:focus-visible { outline: 3px solid var(--tiger-flame); }
@media (max-width: 720px) {
  .site-nav-wrap { justify-content: space-between; }
  .menu-toggle { display: block; }
  nav ul {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + .5rem);
    flex-direction: column;
    background: var(--bg-peach);
    padding: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    gap: .5rem;
    display: none;
  }
  nav ul[data-visible="true"] {
    display: flex;
  }
  nav a { width: 100%; display: block; padding: .75rem; }
}

/* Hero (Full Height) */
.hero-full { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; margin: 0; }
.hero-full::before { content: none; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(.8); }
.hero-content { position: relative; max-width: 750px; padding: 2rem 1.5rem 3rem; border-radius: var(--radius-md); }
.hero-content h1 { margin: 0 0 1rem; font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 600; letter-spacing: .5px; }
.hero-content p { margin: 0 auto; font-size: clamp(1.05rem, 2.5vw, 1.3rem); line-height: 1.6; }
@media (max-width: 600px) { .hero-content h1 { font-size: clamp(1.9rem, 7vw, 2.4rem); } .hero-content p { font-size: 1rem; } }

/* Cards & Sections */
section { margin-top: 3rem; }
section:first-of-type { margin-top: 2rem; }
.hero-full { margin-top: 0; margin-bottom: 0; }
.section-heading { font-size: 1.9rem; margin: 0 0 1.25rem; font-weight: 600; color: var(--twilight-indigo); letter-spacing: .5px; }
.cards { display: grid; gap: 2rem; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); } }
.card { background: #fff; padding: 1.4rem 1.35rem 1.65rem; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); position: relative; display: flex; flex-direction: column; gap: .85rem; transition: var(--transition); }
.card:hover, .card:focus-within { transform: translateY(-5px); box-shadow: var(--shadow-soft-hover); }
.card h3 { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--twilight-indigo); }
.card p { margin: 0; font-size: .97rem; }

/* Card Icon Circles */
.card-icon { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg,var(--tiger-flame),var(--dusty-denim)); display: flex; align-items: center; justify-content: center; font-size: 1.9rem; color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.12); }
.card-icon.alt { background: linear-gradient(135deg,var(--twilight-indigo),var(--dark-amethyst)); }

/* Floating Photos */
.float-img { width: 150px; border-radius: var(--radius-sm); float: right; margin: 0 0 1rem 1.5rem; box-shadow: var(--shadow-soft); background: linear-gradient(135deg,var(--dusty-denim),var(--tiger-flame)); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: .9rem; }
@media (max-width: 700px) { .float-img { float: none; margin: 0 auto 1.2rem; } }

/* Buttons */
.btn { display: inline-block; background: var(--tiger-flame); color: #fff; padding: .65rem 1.2rem; border-radius: 25px; font-weight: 600; font-size: .95rem; box-shadow: 0 5px 16px rgba(244,96,54,0.35); transition: var(--transition); }
.btn:hover, .btn:focus-visible { background: var(--dark-amethyst); box-shadow: 0 6px 20px rgba(55,34,72,0.4); }

/* Footer */
footer { background: var(--twilight-indigo); color: #fff; padding: 1rem 1rem 1.25rem; text-align: center; border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin-top: 2rem; }
footer p { margin: .2rem 0; }
footer a { color: #fff; text-decoration: underline; }
footer a:hover { color: var(--tiger-flame); }

/* Utility Flow */
.flow > * + * { margin-top: var(--flow-space,1rem); }

/* Image placeholders if <img src> omitted */
.placeholder-img { width: 100%; height: 150px; border-radius: var(--radius-sm); background: linear-gradient(135deg,var(--tiger-flame),var(--dusty-denim)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-soft); }

/* Media Queries Spacing Tweaks */
@media (min-width: 900px) { .section-heading { font-size: 2.1rem; } }

/* Make the homepage hero slightly taller on roomy screens for subtle scroll */
@media (min-width: 800px) and (min-height: 700px) {
  .hero-full { min-height: 120vh; }
}

/* Reduce gaps on small screens */
@media (max-width: 480px) { nav ul { gap: 1.25rem; } }

/* Home-specific spacing: remove extra gaps around hero */
main.home { padding-bottom: 0; min-height: 100vh; }
body.home footer { margin-top: 0; position: static; }
body.home .hero-content { padding-top: 5.5rem; padding-bottom: 4.5rem; }

/* Homepage full-page background behind all content */
body.home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* Apply a site-wide dim overlay over the photo so it reaches under the header */
  background-image: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)), url('../images/home/CB+EG-12.webp');
  /* Ensure the very top of the photo is visible at the top of the screen */
  background-position: top center, top center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
}
/* (Reverted) Home-specific full-page background and overlay nudge removed */

/* Allow the background layer to scroll with the page on touch screens to avoid repaint jitter */
@media (hover: none) and (pointer: coarse) {
  body.home { background-color: #000; }
  body.home::before {
    position: absolute;
    background-attachment: scroll;
    height: 100%;
    min-height: 100vh;
  }
}

/* Mobile hero refinements: crop more of the image bottom and tighten spacing */
@media (max-width: 720px) {
  body.home::before {
    background-size: auto 100%;
    background-position: 45% 5%;
  }
  .hero-full { min-height: 85vh; }
  body.home .hero-content {
    padding-top: 3.75rem;
    padding-bottom: 2.5rem;
  }
  main.home { min-height: auto; padding-bottom: 1rem; }
  body.home footer { margin-top: 0; }
}

/* =============================
   Guide Page Layout (2-Column)
   ============================= */

.guide-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  max-width: 1100px;
  margin-top: 2rem;
  position: relative;
}

/* Left Sidebar */
#sidebar {
  display: none; /* Hidden on mobile by default */
}

@media (min-width: 900px) {
  #sidebar {
    display: block;
  }
  .sidebar-inner {
    position: sticky;
    top: 100px; /* Below header */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 1rem;
  }
}

ul.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 0;
}

.sidebar-nav ul {
  padding-left: 1rem;
  margin-top: 0.5rem;
  gap: 0.25rem;
  display: flex;
  flex-direction: column;
}

.sidebar-group-title {
  font-weight: 700;
  color: var(--twilight-indigo);
  display: block;
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  color: var(--midnight-violet);
  font-size: 0.95rem;
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--tiger-flame);
  background: rgba(244,96,54,0.05);
}

/* Main Content Area */
#content {
  min-width: 0; /* Prevent grid blowout */
}

.page-title {
  font-size: 2.5rem;
  color: var(--twilight-indigo);
  margin-bottom: 1rem;
}

.intro-text {
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 65ch;
}

.section-category {
  font-size: 2rem;
  color: var(--tiger-flame);
  border-bottom: 2px solid rgba(244,96,54,0.2);
  padding-bottom: 0.5rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

article {
  margin-bottom: 3rem;
  scroll-margin-top: 100px; /* Offset for sticky header */
}

article h3 {
  font-size: 1.5rem;
  color: var(--twilight-indigo);
  margin-bottom: 1rem;
}

/* Right TOC */
#toc {
  display: none;
}

@media (min-width: 1100px) {
  #toc {
    display: block;
  }
  .toc-inner {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border-left: 1px solid rgba(0,0,0,0.1);
    padding-left: 1.5rem;
  }
}

.toc-inner h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dusty-denim);
  margin-top: 0;
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toc-list a {
  font-size: 0.9rem;
  color: var(--midnight-violet);
  display: block;
  line-height: 1.4;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  margin-left: -0.75rem; /* Pull back to align border */
  transition: all 0.2s;
}

.toc-list a:hover {
  color: var(--tiger-flame);
}

.toc-list a.active {
  color: var(--tiger-flame);
  border-left-color: var(--tiger-flame);
  font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .guide-layout {
    display: block; /* Stack everything */
    padding: 0 1rem;
  }
  #sidebar, #toc {
    display: none; /* Hide sidebars on mobile for now */
  }
}

/* Place Details */
.place {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0,0,0,0.05);
}

.place h4 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: var(--twilight-indigo);
}

.place p {
  margin-bottom: 1rem;
  color: var(--midnight-violet);
}

.place-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: block;
  object-fit: cover;
  max-height: 400px; /* Prevent them from being too tall */
}

.details {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  background: var(--bg-peach);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.details li {
  margin-bottom: 0.5rem;
}

.details li:last-child {
  margin-bottom: 0;
}

.details strong {
  color: var(--tiger-flame);
  font-weight: 600;
  margin-right: 0.25rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--tiger-flame);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
  z-index: 100;
  box-shadow: var(--shadow-soft);
}

.back-to-top:hover {
  background-color: var(--dark-amethyst);
  color: white;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

