/* Scruffy's Travels — one stylesheet for the whole site.
   Shared basics first, then one block per page (scoped by the class on <body>). */

/* ---------- Shared ---------- */

:root {
  color-scheme: light dark;
  --ink: light-dark(#24342f, #edf3ec);
  --muted: light-dark(#5e6b63, #b4c0b6);
  --paper: light-dark(#fbf8ef, #18231f);
  --panel: light-dark(#fffdf7, #22312b);
  --line: light-dark(#e5dfd1, #3b4a42);
  --green: light-dark(#315d48, #a7d0ad);
  --orange: light-dark(#d67d4c, #f0ad79);
  --on-green: light-dark(#fff, #15241b); /* text on green buttons/blocks */
}

/* Theme chosen with the toggle (theme.js); without a choice the device setting is followed */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: auto; }

.brand { font-weight: 900; font-size: 1.25rem; text-decoration: none; }
.brand span { color: var(--orange); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .75rem;
  font-weight: 900;
  color: var(--green);
}

h1 em { font-family: Georgia, serif; font-weight: 500; color: var(--orange); }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 13px 19px;
  background: var(--green);
  color: var(--on-green);
  font-weight: 800;
  text-decoration: none;
}

/* Site header + menu (same on every page) */
.site-header { min-height: 78px; display: flex; align-items: center; gap: 18px; }
.site-menu { display: flex; align-items: center; gap: 26px; order: 1; margin-left: auto; }
.site-menu a { text-decoration: none; font-weight: 700; }
.site-menu a[aria-current="page"]:not(.pill) { color: var(--green); }

.menu-toggle { display: none; }

/* Theme toggle: after the menu on desktop, left of the hamburger on mobile.
   Shows the current mode: half circle = auto, sun = light, moon = dark. */
.theme-toggle { display: none; }
.js-theme .theme-toggle {
  order: 2;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: none; }
.theme-toggle[data-mode="auto"] .i-auto,
.theme-toggle[data-mode="light"] .i-light,
.theme-toggle[data-mode="dark"] .i-dark { display: block; }

@media (max-width: 760px) {
  .wrap { width: min(100% - 30px, 560px); }
  .site-header { min-height: 68px; padding: 12px 0; }
}

/* Menu becomes a hamburger below 880px (the 5-item home menu starts wrapping around 850-860px) */
@media (max-width: 880px) {
  .site-header { flex-wrap: wrap; gap: 0 10px; }
  .site-menu { flex-wrap: wrap; gap: 10px 16px; padding: 4px 0 8px; order: 3; margin-left: 0; }
  .js-theme .theme-toggle { order: 0; margin-left: auto; }

  /* Hamburger: only once menu.js is running (without JS the links stay visible) */
  .js-menu .site-header .menu-toggle {
    display: inline-grid;
    place-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--ink);
    cursor: pointer;
  }
  .menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s, opacity .2s; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .js-menu .site-header .site-menu {
    flex-basis: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    text-align: center;
    transition: max-height .3s ease, padding .3s ease, visibility 0s linear .3s;
  }
  .js-menu .site-header.is-open .site-menu {
    max-height: 420px;
    padding: 14px 0 18px;
    visibility: visible;
    transition: max-height .3s ease, padding .3s ease, visibility 0s;
  }
  .js-menu .site-header .site-menu a:not(.pill) { padding: 10px 16px; font-size: 1.05rem; }
  .js-menu .site-header .site-menu .pill { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle span, .site-menu { transition: none !important; }
}


/* ---------- Home (index.html) ---------- */

.page-home .hero { padding: 55px 0 85px; display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.page-home h1 { font-size: clamp(3.3rem, 7vw, 6.7rem); line-height: .91; letter-spacing: -.075em; margin: 18px 0 22px; }
.page-home .lead { font-size: 1.14rem; line-height: 1.7; color: var(--muted); max-width: 500px; }
.page-home .actions { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; margin-top: 28px; }
.page-home .textlink { font-weight: 800; text-decoration: none; border-bottom: 1px solid var(--line); padding: 10px 0; }

.page-home .hero-photo { position: relative; min-height: 420px; border-radius: 28px; overflow: hidden; background: #d9e7d6; }
.page-home .hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.page-home .sticker,
.page-home .caption { position: absolute; z-index: 2; background: #fff9e9; color: #31483a; padding: 12px 15px; border-radius: 15px; font-weight: 800; }
.page-home .caption { left: 18px; top: 18px; z-index: 4; border-radius: 999px; }
.page-home .sticker { right: 12px; bottom: 25px; font-family: Georgia, serif; transform: rotate(5deg); }

.page-home .section { padding: 78px 0; border-top: 1px solid var(--line); }
.page-home .about { display: grid; grid-template-columns: .85fr 1.15fr; gap: 50px; align-items: center; }
.page-home .aboutphoto { width: 100%; object-fit: cover; border-radius: 28px; display: block; background: var(--panel); }
.page-home h2 { font-size: clamp(2.2rem, 4vw, 3.6rem); letter-spacing: -.06em; line-height: 1; margin: 12px 0; }
.page-home .quote { font: clamp(1.8rem, 3.4vw, 3rem)/1.25 Georgia, serif; }
.page-home .quote span { color: var(--orange); }
.page-home .aboutbox,
.page-home .card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 25px; }
.page-home .aboutbox { margin-top: 24px; }
/* second box below photo + text, full width, three columns (birthday / cats / chicken) */
.page-home .aboutbox-wide { margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.page-home .aboutbox-wide p { margin: 0; }
.page-home .aboutbox p,
.page-home .card p { color: var(--muted); line-height: 1.7; }
.page-home .stats { display: flex; gap: 10px; flex-wrap: wrap; }
.page-home .tag { border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; font-size: .84rem; font-weight: 750; }

.page-home .sectionhead { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 30px; }
.page-home .sectionhead p { max-width: 420px; color: var(--muted); line-height: 1.65; }
.page-home .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.page-home .card .icon { font-size: 2rem; }
.page-home .card h3 { margin: 17px 0 8px; }

.page-home .cta-section { padding: 28px 0 78px; }
.page-home .cta { background: var(--green); color: var(--on-green); border-radius: 30px; padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.page-home .cta h2 { margin: 0 0 10px; }
.page-home .cta .pill { background: var(--paper); color: var(--ink); }

.page-home .footer { padding: 32px 0 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: .88rem; }
.page-home .footer a { font-weight: 800; text-decoration: none; color: var(--ink); }

@media (max-width: 760px) {
  .page-home .hero { padding: 38px 0 60px; grid-template-columns: 1fr; gap: 35px; }
  .page-home .hero-photo { min-height: 340px; }
  .page-home .section { padding: 58px 0; }
  .page-home .sectionhead,
  .page-home .about { display: block; }
  .page-home .cards { grid-template-columns: 1fr; }
  .page-home .aboutbox-wide { grid-template-columns: 1fr; gap: 16px; }
  .page-home .aboutphoto { height: auto; object-fit: contain; margin-bottom: 25px; }
  .page-home .cta { padding: 30px; display: block; }
  .page-home .cta .pill { margin-top: 24px; }
  .page-home .footer { flex-direction: column; }
}


/* ---------- Travels (travels.html) ---------- */

.page-travels .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 11px 15px;
  background: var(--green);
  color: var(--on-green);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 800;
}
.page-travels .button:hover { filter: brightness(1.08); }

.page-travels .hero { padding: 58px 0 48px; }
.page-travels h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); line-height: .95; letter-spacing: -.075em; margin: 14px 0 18px; }
.page-travels .intro { max-width: 650px; color: var(--muted); font-size: 1.08rem; line-height: 1.75; }

.page-travels .section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 18px 0 24px; }
.page-travels .section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.06em; margin: 0; }
.page-travels .section-head p { color: var(--muted); margin: 0; line-height: 1.6; max-width: 420px; }

.page-travels .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: 72px; }
.page-travels .place { display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 8px 26px #24342f0a; }

/* Square photo area; the full travel photo is shown without cropping. */
.page-travels .photo {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #d9e7d6, #f3d9b8);
  display: grid;
  place-items: center;
  color: #315d48;
  font-size: 3rem;
}
.page-travels .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }

.page-travels .body { position: relative; z-index: 1; flex: 1 0 auto; background: var(--panel); padding: 21px; }
.page-travels .meta { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 900; color: var(--green); }
.page-travels h3 { font-size: 1.3rem; margin: 8px 0; }
.page-travels .body p { color: var(--muted); line-height: 1.65; margin: 0 0 18px; }

.page-travels .note { border-top: 1px solid var(--line); padding: 25px 0 34px; color: var(--muted); font-size: .9rem; display: flex; justify-content: space-between; gap: 15px; }
.page-travels .note a { color: var(--ink); font-weight: 800; text-decoration: none; }

@media (max-width: 760px) {
  .page-travels .hero { padding: 38px 0 30px; }
  .page-travels .section-head { display: block; }
  .page-travels .section-head p { margin-top: 10px; }
  .page-travels .grid { grid-template-columns: 1fr; gap: 15px; padding-bottom: 45px; }
  .page-travels .note { flex-direction: column; }
}
@media (min-width: 520px) and (max-width: 760px) {
  .page-travels .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ---------- Scruffy's picks (links.html) ---------- */

.page-picks .hero { padding: 68px 0 48px; max-width: 820px; }
.page-picks h1 { font-size: clamp(3.3rem, 7vw, 6.2rem); line-height: .91; letter-spacing: -.075em; margin: 18px 0 22px; }
.page-picks h1 em { letter-spacing: -.08em; }
.page-picks .lead { font-size: 1.14rem; line-height: 1.7; color: var(--muted); max-width: 650px; }

.page-picks .groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 42px 28px; padding: 12px 0 65px; }
.page-picks .group h2 { font-size: 1.5rem; letter-spacing: -.04em; margin: 0 0 16px; }
.page-picks .links { display: grid; gap: 12px; }
.page-picks .link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px 21px;
  min-height: 88px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  text-decoration: none;
  transition: transform .18s, border-color .18s;
}
.page-picks .link:hover { transform: translateY(-2px); border-color: var(--green); }
.page-picks .icon { font-size: 1.7rem; width: 36px; text-align: center; }
.page-picks .link strong { display: block; font-size: 1rem; }
.page-picks .link small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.page-picks .arrow { margin-left: auto; color: var(--green); font-weight: 900; font-size: 1.2rem; }

.page-picks .collab { background: var(--green); color: var(--on-green); border-radius: 30px; padding: 40px 44px; display: flex; justify-content: space-between; align-items: center; gap: 28px; margin: 0 0 25px; }
.page-picks .collab h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.05em; margin: 0 0 8px; }
.page-picks .collab p { line-height: 1.6; margin: 0; max-width: 650px; opacity: .9; }
.page-picks .collab a { display: inline-flex; white-space: nowrap; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 850; padding: 13px 18px; border-radius: 999px; }

.page-picks .note { font-size: .82rem; color: var(--muted); line-height: 1.6; margin: 0 0 30px; }

.page-picks .footer { padding: 32px 0 40px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.page-picks .footer a { font-weight: 800; text-decoration: none; color: var(--ink); }

@media (max-width: 760px) {
  .page-picks .hero { padding: 45px 0 30px; }
  .page-picks .groups { grid-template-columns: 1fr; gap: 30px; padding-bottom: 45px; }
  .page-picks .collab { display: block; padding: 30px; }
  .page-picks .collab a { margin-top: 20px; }
  .page-picks .footer { flex-direction: column; }
}
