/* ---------------------------------------------------------
   Backroad Diary — "made it myself" amateur-but-modern look.

   The tell: nav links and buttons got deliberately styled
   (that felt like "designing"), but links inside actual
   sentences were left plain default blue — nobody thinks to
   restyle those. That inconsistency is the signature here,
   not a decoration on top of it.
--------------------------------------------------------- */
:root {
  --bg:             #EFEEE9;  /* soft warm gray, not stark white, not cream */
  --card:           #FAFAF6;  /* entry cards sit a shade lighter than the page */
  --ink:            #222222;
  --favorite:       #2F6B45;  /* their one favorite color, used a bit too much */
  --favorite-dark:  #1F4A30;
  --favorite-light: #E7F2EA;
  --link-default:   #0000EE; /* never overridden inside body copy — see note above */
  --off:            #B3261E; /* reserved: entries where the story turns */
  --off-light:      #FBEAE8;

  --font-title: "Caveat", cursive;
  --font-body: "Nunito", "Segoe UI", Arial, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

/* baseline link style — intentionally left plain, see file header */
a {
  color: var(--link-default);
  text-decoration: underline;
}
a:visited { color: #551A8B; }
a:focus-visible {
  outline: 2px solid var(--favorite);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   Nav — the one part that got actually "designed"
--------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid #E4E4E4;
}

.nav {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nav-logo,
.nav-links a {
  color: var(--favorite);
  text-decoration: none;
  font-weight: 700;
}

.nav-logo {
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-logo:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------
   Hero — a banner photo that's a little too wide, the way
   a Canva export at the wrong size tends to be
--------------------------------------------------------- */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1rem;
  text-align: center;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 16 / 4.5;
  background: repeating-linear-gradient(45deg, var(--favorite-light), var(--favorite-light) 10px, #DCEEE1 10px, #DCEEE1 20px);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--favorite-dark);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
  overflow: hidden;
}

.hero-photo:has(img) {
  padding: 0;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-title {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--favorite);
  font-size: clamp(2.5rem, 8vw, 3.4rem);
  margin: 1rem 0 0.35rem;
  line-height: 1;
}

.hero-tagline {
  max-width: 30rem;
  margin: 0 auto;
  color: #4A4A4A;
  font-size: 1rem;
}

/* ---------------------------------------------------------
   About — a "card" because cards feel more designed
--------------------------------------------------------- */
.about {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.about-card {
  background: var(--favorite-light);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 6px 18px rgba(47, 107, 69, 0.18);
}

.about-heading {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--favorite-dark);
  font-size: 1.05rem;
}

.about-text {
  margin: 0;
  color: #333;
}

/* ---------------------------------------------------------
   Diary entries
--------------------------------------------------------- */
.entries-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.entries-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.1rem;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.entry {
  background: var(--card);
  border-left: 5px solid var(--favorite);
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  padding: 1.1rem 1.25rem 1.3rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.entry.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.entry[data-tone="off"] {
  border-left-color: var(--off);
  background: var(--off-light);
}

.entry-date {
  display: block;
  font-weight: 700;
  color: var(--favorite-dark);
  font-size: 0.85rem;
  margin: 0 0 0.6rem;
}

.entry[data-tone="off"] .entry-date {
  color: var(--off);
}

.entry-photo {
  display: block;
  border-radius: 8px;
  object-fit: cover;
  margin: 0 0 0.75rem;
}

/* real phone photos don't come out the same shape twice */
.entry-photo[data-size="wide"]   { width: 100%; aspect-ratio: 16 / 9; }
.entry-photo[data-size="square"] { width: 220px; max-width: 100%; aspect-ratio: 1 / 1; }
.entry-photo[data-size="small"]  { width: 160px; max-width: 100%; aspect-ratio: 4 / 3; }

.entry-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--favorite-light);
  color: var(--favorite-dark);
  font-size: 0.72rem;
  text-align: center;
  padding: 0.5rem;
}

.entry[data-tone="off"] .entry-photo.placeholder {
  background: #F3D9D6;
  color: var(--off);
}

.entry-caption {
  margin: 0;
  color: #333;
}

.entry[data-tone="off"] .entry-caption {
  color: #5C1712;
}

.entries-end {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin: 1.75rem 0 0;
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  text-align: center;
  border-top: 1px solid #E4E4E4;
  font-size: 0.9rem;
  color: #555;
}

.counter-line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 1.2rem 0 0.9rem;
}

#hit-counter {
  font-weight: bold;
  color: var(--favorite-dark);
}

#hit-counter.is-glitching {
  color: var(--off);
  animation: counter-flicker 0.2s steps(2) infinite;
}

@keyframes counter-flicker {
  0%   { opacity: 1; }
  50%  { opacity: 0.55; }
  100% { opacity: 1; }
}

.footer-signoff {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  color: #999;
}

@media (prefers-reduced-motion: reduce) {
  .entry { transition: none; opacity: 1; transform: none; }
  #hit-counter.is-glitching { animation: none; color: var(--off); }
}

@media (max-width: 480px) {
  .nav { justify-content: center; text-align: center; }
  .nav-links { gap: 1rem; }
}
