/*
Theme Name: Little Trailblazer
Theme URI: https://example.com/little-trailblazer
Author: Little Trailblazer
Description: A trail-log style theme for capturing a young athlete's milestones — hikes, games, and everything in between. The homepage is a gallery of waypoints; click any photo to open the full story.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: little-trailblazer
*/

/* -------------------------------------------------
   0. Design tokens
------------------------------------------------- */
:root {
  --pine: #1F3D2B;
  --meadow: #4C7A57;
  --clay: #A9653B;
  --sky: #3E7CB1;
  --paper: #FBF8F2;
  --paper-dim: #F1ECE0;
  --sunrise: #E8895C;
  --ink: #23291F;
  --line: rgba(31, 61, 43, 0.14);

  --display: 'Fredoka', 'Segoe UI', sans-serif;
  --body: 'Work Sans', 'Segoe UI', sans-serif;
  --mono: 'Space Mono', 'Courier New', monospace;

  --radius: 14px;
  --max: 1160px;
}

@font-face {
  font-family: 'Fredoka';
  src: local('Fredoka');
  font-weight: 400 700;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--sunrise);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--pine);
  line-height: 1.15;
  margin: 0 0 0.4em;
}

/* -------------------------------------------------
   1. Signature element: the contour/trail line
   Used as dividers so photos read as waypoints
   strung along a single path.
------------------------------------------------- */
.trail-divider {
  width: 100%;
  height: 34px;
  display: block;
  color: var(--meadow);
}

.trail-divider path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* -------------------------------------------------
   2. Header
------------------------------------------------- */
.site-header {
  background: var(--pine);
  color: var(--paper);
  padding: 34px 0 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 26px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 14px;
}

.trail-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: var(--sunrise);
}

.site-title {
  font-family: var(--display);
  font-size: 1.65rem;
  color: var(--paper);
  margin: 0;
  letter-spacing: 0.01em;
}

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

.site-description {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--paper);
  opacity: 0.72;
  margin: 2px 0 0;
  letter-spacing: 0.02em;
}

/* Custom logo — any uploaded photo is framed into the same circular
   trail-badge treatment as the default mark, so it always looks
   intentional regardless of the source image's shape. */
.custom-logo-link {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.custom-logo-link::after {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  border: 2px dashed var(--meadow);
  pointer-events: none;
}

.custom-logo {
  height: 84px;
  width: 84px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--paper);
  box-shadow: 0 0 0 3px var(--pine);
  display: block;
}

.trail-mark-link {
  display: inline-flex;
  flex-shrink: 0;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--paper);
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.88;
}

.main-nav a:hover { opacity: 1; text-decoration: none; border-bottom: 2px solid var(--sunrise); }

.header-trail {
  color: var(--meadow);
  background: var(--paper);
}

/* -------------------------------------------------
   3. Gallery grid (front page)
------------------------------------------------- */
.gallery-intro {
  padding: 48px 0 8px;
  text-align: center;
}

.gallery-intro h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
}

.gallery-intro p {
  max-width: 560px;
  margin: 10px auto 0;
  color: var(--meadow);
  font-size: 1.05rem;
}

.waypoint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  padding: 36px 0 64px;
}

.waypoint {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-dim);
  aspect-ratio: 4 / 5;
  display: block;
  box-shadow: 0 1px 2px rgba(31,61,43,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  animation: rise 0.5s ease forwards;
}

.waypoint:nth-child(2n) { animation-delay: 0.05s; }
.waypoint:nth-child(3n) { animation-delay: 0.1s; }
.waypoint:nth-child(4n) { animation-delay: 0.15s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .waypoint { animation: none; opacity: 1; }
  html { scroll-behavior: auto; }
}

.waypoint:hover, .waypoint:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(31,61,43,0.22);
  text-decoration: none;
}

.waypoint img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.waypoint .no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--meadow);
  font-family: var(--display);
  font-size: 0.95rem;
  background: linear-gradient(160deg, var(--paper-dim), #E4EDE1);
}

.waypoint .veil {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 14px 12px;
  background: linear-gradient(to top, rgba(20,32,22,0.86), transparent);
  color: var(--paper);
}

.waypoint .veil h2 {
  color: var(--paper);
  font-size: 1.02rem;
  margin: 0 0 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  background: var(--clay);
  color: var(--paper);
  padding: 3px 9px;
  border-radius: 100px;
  margin: 0 6px 4px 0;
}

.badge.age { background: var(--sunrise); }
.badge.stat { background: var(--sky); }

.empty-trail {
  text-align: center;
  padding: 80px 20px;
  color: var(--meadow);
}

.empty-trail a {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--display);
  color: var(--pine);
  border: 2px solid var(--pine);
  padding: 8px 18px;
  border-radius: 100px;
}

/* -------------------------------------------------
   4. Single story page
------------------------------------------------- */
.story-hero {
  position: relative;
  background: var(--pine);
}

.story-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  opacity: 0.94;
}

.story-hero .story-header {
  padding: 40px 0 26px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--paper);
  opacity: 0.85;
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-bottom: 16px;
}

.back-link:hover { opacity: 1; text-decoration: none; }

.story-header h1 {
  color: var(--paper);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.stat-bar {
  padding: 14px 0 0;
}

article.story {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 28px 90px;
}

article.story .story-meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--meadow);
  margin-bottom: 24px;
}

article.story .content p { margin: 0 0 1.3em; }

article.story .content h2 {
  margin-top: 1.6em;
  font-size: 1.4rem;
}

article.story .content img {
  border-radius: var(--radius);
  margin: 1.6em 0;
}

article.story .content blockquote {
  border-left: 3px solid var(--sunrise);
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.2em;
  color: var(--meadow);
  font-style: italic;
}

.story-nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 30px;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: 0.92rem;
}

.story-nav a { color: var(--pine); }

/* -------------------------------------------------
   5. Standard pages
------------------------------------------------- */
.site-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 28px 90px;
}

.site-page h1 { font-size: 2rem; margin-bottom: 0.6em; }

/* -------------------------------------------------
   6. Footer
------------------------------------------------- */
.site-footer {
  background: var(--pine);
  color: var(--paper);
  padding: 30px 0 34px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  opacity: 0.85;
}

.site-footer .trail-divider { color: var(--sunrise); margin-bottom: 12px; }

/* -------------------------------------------------
   7. Responsive
------------------------------------------------- */
@media (max-width: 640px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .waypoint-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  article.story { padding: 34px 20px 70px; }
}
