/* ============================================================
   Simple Sourdough — styles.css
   Clean, mobile-first styling for Eleventy + Azure SWA
   ============================================================ */

/* === Root Variables ======================================= */

:root {
  --bg: #f6f2e9;
  --accent: #e6ddcf;
  --text: #333;
  --shadow: rgba(0, 0, 0, 0.18);
  --border-light: rgba(0, 0, 0, 0.1);
}

/* === Base Styles ========================================== */

body {
  font-family: Georgia, serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

/* === Header & Navigation ================================== */

header {
  text-align: center;
  background: var(--accent);
  padding: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
}

header h1 a {
  text-decoration: none;
  color: inherit;
}

header h1 a:hover {
  text-decoration: underline;
}

header h2 {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: normal;
  opacity: 0.85;
}

/* Navigation Bar */
nav {
  margin-top: 1rem;
}

nav a {
  margin: 0 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
}

nav a:hover,
nav a.active {
  text-decoration: underline;
  color: #111;
}

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

.hero-wrapper {
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
}

.hero {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 14px var(--shadow);
  transform: translateZ(0);
  will-change: transform;
}

/* Larger screens */
@media (min-width: 900px) {
  .hero {
    max-height: 450px;
  }
}

/* Smaller screens */
@media (max-width: 600px) {
  .hero {
    max-height: 280px;
  }
}

/* === Main Content ========================================= */

main {
  max-width: 900px;
  margin: auto;
  padding: 1.5rem;
}

section {
  margin-bottom: 2rem;
}

main img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Markdown Headings */
main h2,
main h3,
main h4,
main h5,
main h6 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

/* Paragraph rhythm */
main p {
  margin-bottom: 1rem;
  line-height: 1.55;
}

/* Ordered lists */
ol li {
  margin-bottom: 0.65rem;
  line-height: 1.45;
}

/* === Expandable Sections (Glossary, etc.) ================= */

details {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f0e7d9;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

details[open] {
  background: #e9dfcf;
}

details summary {
  cursor: pointer;
  font-size: 1.1rem;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: " ⌄";
  float: right;
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(180deg);
}

@media (max-width: 480px) {
  details summary {
    font-size: 1rem;
  }
}

/* === Gallery ============================================== */

/* Group heading */
.gallery-group {
  margin-bottom: 3rem;
}

.gallery-group h2 {
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: normal;
  text-align: left;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  color: #222;
  letter-spacing: 0.5px;
}

.gallery-group h2::first-letter {
  text-transform: uppercase;
}

/* Responsive image grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

/* Each image container */
.gallery figure {
  position: relative;
  margin: 0;
  background: #fdfaf4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery figure:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Image */
.gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

/* Caption overlay (hover reveal) */
.gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.9rem;
  padding: 0.5rem;
  text-align: center;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Reveal on hover */
.gallery figure:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive: multi-column scaling */
@media (min-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Phones: single column with static captions */
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery img {
    height: auto;
  }

  .gallery-group h2 {
    text-align: center;
    font-size: 1.4rem;
  }

  .gallery figcaption {
    position: relative;
    background: #222;
    opacity: 1;
    transform: none;
  }
}

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

footer {
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
  background: var(--accent);
}

/* === Mobile Header / Nav Tweaks =========================== */

@media (max-width: 600px) {
  header h1 {
    font-size: 1.85rem;
  }

  header h2 {
    font-size: 1rem;
    margin-top: 0.5rem;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
  }

  nav a {
    font-size: 0.85rem;
    margin: 0;
    padding: 0.3rem 0.4rem;
  }
}
