/* ===================================================
   Nead Sionnach — Shared Stylesheet
   Modern Mountain Blend
   =================================================== */

/* --- Custom Properties --- */
:root {
  --color-text: #2d3436;
  --color-heading: #2d5016;
  --color-bg: #faf9f7;
  --color-bg-alt: #f0ede8;
  --color-accent: #8b6914;
  --color-card: #ffffff;
  --color-border: #d5d0c8;
  --color-muted: #636e72;
  --color-warning-bg: #fff8e1;
  --color-warning-border: #f9a825;
  --color-danger-bg: #fce4ec;
  --color-danger-border: #c62828;
  --color-info-bg: #e8f5e9;
  --color-info-border: #2d5016;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --max-width: 1200px;
  --header-height: 64px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

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

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

a {
  color: var(--color-heading);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

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

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Site Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.site-header__brand {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-heading);
  text-decoration: none;
  font-weight: 700;
}

.site-header__brand:hover {
  color: var(--color-accent);
}

.site-header__tagline {
  display: none;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-left: 1rem;
  font-style: italic;
}

.site-header__nav a {
  font-size: 0.9rem;
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 500;
  color: var(--color-text);
}

.site-header__nav a:hover {
  color: var(--color-accent);
}

@media (min-width: 768px) {
  .site-header__tagline {
    display: inline;
  }
}

/* --- Hero --- */
.hero {
  background: var(--color-bg-alt);
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.hero__subtitle {
  font-size: 1.2rem;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 2rem;
}

.hero__image {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

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

/* --- Sections --- */
.section {
  padding: 3.5rem 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section__title {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.section__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* --- Cards --- */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
}

.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

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

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

/* --- Notice Banner --- */
.notice {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  padding: 2rem;
  border-radius: 0 8px 8px 0;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.notice h2 {
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.notice p {
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* --- Photo Gallery --- */
.gallery-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 200px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 6px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

.gallery-item--portrait {
  grid-row: span 2;
}

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

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 0.6rem;
  }
}

/* --- Gallery Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.lightbox__close:hover {
  opacity: 1;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
}

.lightbox__nav:hover {
  opacity: 1;
}

.lightbox__nav--prev {
  left: 1rem;
}

.lightbox__nav--next {
  right: 1rem;
}

/* --- Guest Access CTA --- */
.cta {
  text-align: center;
}

.cta-button {
  display: inline-block;
  background: var(--color-heading);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.1s;
}

.cta-button:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
}

.cta-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* --- Site Footer --- */
.site-footer {
  background: var(--color-text);
  color: var(--color-bg-alt);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--color-bg-alt);
}

/* ===================================================
   GUEST GUIDE – Layout & Components
   =================================================== */

/* --- Guide Layout (sidebar + content) --- */
.guide-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - var(--header-height));
}

.guide-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 1.5rem;
  max-width: 55rem;
}

/* --- TOC Sidebar (desktop) --- */
.toc-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .toc-sidebar {
    display: block;
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--color-border);
    background: var(--color-card);
    font-size: 0.85rem;
  }

  .toc-sidebar__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-heading);
    margin-bottom: 1rem;
    font-weight: 700;
  }

  .toc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .toc-sidebar li {
    margin-bottom: 0;
  }

  .toc-sidebar a {
    display: block;
    padding: 0.3rem 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
  }

  .toc-sidebar a:hover {
    background: var(--color-bg-alt);
    color: var(--color-heading);
  }

  .toc-sidebar a.active {
    background: var(--color-bg-alt);
    color: var(--color-heading);
    font-weight: 600;
  }

  .toc-sidebar ul ul {
    padding-left: 0.75rem;
  }

  .toc-sidebar ul ul a {
    font-size: 0.8rem;
    color: var(--color-muted);
  }

  .guide-layout {
    gap: 0;
  }

  .guide-content {
    padding: 2rem 3rem;
  }
}

/* --- Mobile TOC --- */
.toc-mobile {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.toc-mobile__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
  cursor: pointer;
}

.toc-mobile__toggle::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.2s;
}

.toc-mobile.open .toc-mobile__toggle::after {
  content: "\2212";
}

.toc-mobile__list {
  display: none;
  padding: 0 1.25rem 1rem;
}

.toc-mobile.open .toc-mobile__list {
  display: block;
}

.toc-mobile__list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-mobile__list li {
  margin-bottom: 0;
}

.toc-mobile__list a {
  display: block;
  padding: 0.35rem 0;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
}

.toc-mobile__list a:hover {
  color: var(--color-heading);
}

.toc-mobile__list ul ul {
  padding-left: 1rem;
}

.toc-mobile__list ul ul a {
  font-size: 0.9rem;
  color: var(--color-muted);
}

@media (min-width: 1024px) {
  .toc-mobile {
    display: none;
  }
}

/* --- Guide Section Styling --- */
.guide-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.guide-section:last-child {
  border-bottom: none;
}

.guide-section h2 {
  padding-top: 0.5rem;
}

.guide-section h3 {
  margin-top: 1.5rem;
  color: var(--color-text);
}

/* --- Callout Boxes --- */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1rem 0;
  border-left: 4px solid;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.callout--danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
}

.callout--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
}

.callout strong {
  display: block;
  margin-bottom: 0.25rem;
}

/* --- Contact Card --- */
.contact-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.contact-card h4 {
  color: var(--color-heading);
  margin-bottom: 0.5rem;
}

.contact-card p {
  margin-bottom: 0.25rem;
}

.contact-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

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

/* --- Code / Key Info --- */
.key-info {
  display: inline-block;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-family: "SF Mono", "Consolas", "Liberation Mono", monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* --- PDF Download Button --- */
.download-bar {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.download-bar p {
  margin: 0;
  font-weight: 500;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-heading);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.download-button:hover {
  background: var(--color-accent);
  color: #fff;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--color-heading);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.back-to-top:hover {
  background: var(--color-accent);
}

/* --- Responsive Tables --- */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table-wrap th {
  background: var(--color-bg-alt);
  font-weight: 600;
  color: var(--color-heading);
}

/* --- Guide Welcome --- */
.guide-welcome {
  background: var(--color-bg-alt);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.guide-welcome h1 {
  margin-bottom: 0.5rem;
}

.guide-welcome p {
  margin-bottom: 0;
  color: var(--color-muted);
  font-style: italic;
}

/* --- Guide Figures --- */
.guide-figure {
  margin: 1.25rem 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.guide-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.guide-figure figcaption {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
}

.guide-figure--small {
  max-width: 320px;
}

.guide-figure--medium {
  max-width: 600px;
}

/* --- Print Styles --- */
@media print {
  .site-header,
  .toc-sidebar,
  .toc-mobile,
  .back-to-top,
  .download-bar {
    display: none !important;
  }

  .guide-content {
    padding: 0;
    max-width: 100%;
  }

  .callout {
    border: 1px solid #999;
    break-inside: avoid;
  }

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