/* ============================================================
   Porcia's Greyhound Retirement Home — caplinhome.com
   "Keepsake album": warm paper ground, deep teal rules, rust accents.
   Evolved from the original FrontPage 'teal-blue' greyhound section
   and the 'orange-and-blue' Smooth Fox Terrier section.
   Hand-written, no framework. Sharp corners like the original,
   softened only by paper-weight shadows.
   ============================================================ */

:root {
  --paper:      #faf6ee;
  --paper-2:    #f2ebdd;
  --paper-3:    #e9dfcc;
  --rule:       #d8cbb2;
  --rule-soft:  #e6dcc8;

  --ink:        #23302f;
  --ink-soft:   #55625f;
  --ink-faint:  #7d8785;

  --teal-900:   #10383b;
  --teal-700:   #1c6469;
  --teal-500:   #2b8b8a;
  --teal-100:   #dcebe8;

  --rust:       #b8542a;
  --rust-dark:  #8f3f1e;
  --gold:       #d8a044;

  --measure:    68ch;
  --rail-w:     15rem;
  --shadow:     0 1px 0 var(--rule-soft), 0 10px 26px -18px rgba(16, 56, 59, .55);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 12% 4%, rgba(216, 160, 68, .10), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(43, 139, 138, .10), transparent 46%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Karla", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--teal-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--rust-dark); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--teal-900); color: #fff; padding: .6rem 1rem; z-index: 50;
}
.skip:focus { left: 0; }

.wrap { width: min(74rem, 100% - 2.5rem); margin-inline: auto; }

/* ---------- masthead ---------- */
.masthead {
  background: var(--teal-900);
  background-image: linear-gradient(180deg, #14454a 0%, #10383b 100%);
  border-bottom: 5px solid var(--rust);
}
.masthead-in { padding: 1.5rem 0 1.4rem; }

.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit; }

.brand-mark {
  flex: 0 0 auto;
  width: 3.25rem; height: 3.25rem;
  display: grid; place-items: center;
  background: var(--paper);
  color: var(--teal-900);
  font-family: "Bitter", Georgia, serif;
  font-weight: 700; font-size: 1.85rem; line-height: 1;
  border: 3px solid var(--gold);
}

.brand-txt { display: block; min-width: 0; }

.brand-name {
  display: block;
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 1.1rem + 1.1vw, 1.95rem);
  line-height: 1.15;
  color: var(--paper);
  letter-spacing: -0.01em;
}
.brand-sub {
  display: block;
  margin-top: .3rem;
  font-size: .8125rem;
  font-style: italic;
  color: #a9c9c6;
}

/* ---------- shell ---------- */
.shell {
  display: block;
  padding: 2rem 0 3.5rem;
}

/* ---------- navigation ----------
   Desktop: a vertical rail, honouring the original FrontPage left link bar.
   Mobile:  the SAME markup reflows into wrapping pills. Every link is
            rendered and reachable at every width with CSS alone — there is
            no toggle, nothing is hidden, and nothing depends on JavaScript. */
.rail { margin-bottom: 2rem; }

.sidenav { margin: 0; }

.navgroup {
  margin: 1.15rem 0 .4rem;
  font-family: "Bitter", Georgia, serif;
  font-size: .70rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--rust-dark);
}
.rail .navgroup:first-of-type { margin-top: 0; }

.navlist { list-style: none; margin: 0 0 .35rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }

.navlist a {
  display: block;
  padding: .34rem .72rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--teal-900);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
}
.navlist a:hover, .navlist a:focus-visible {
  background: var(--teal-700); border-color: var(--teal-700); color: var(--paper);
}
.navlist li.is-current a {
  background: var(--teal-900); border-color: var(--teal-900); color: var(--paper);
  box-shadow: inset 3px 0 0 var(--gold);
}

.railnote {
  margin: 1.5rem 0 0;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
  font-size: .8125rem;
  font-style: italic;
  color: var(--ink-faint);
}

/* ---------- content ---------- */
.col { min-width: 0; }

.prose { max-width: var(--measure); }

.prose h1 {
  margin: 0 0 1rem;
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.85rem, 1.4rem + 2vw, 2.85rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--teal-900);
}
.prose h1::after {
  content: "";
  display: block;
  width: 4.5rem; height: 4px;
  margin-top: .85rem;
  background: var(--rust);
}

.prose h2 {
  margin: 2.6rem 0 .8rem;
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.3rem, 1.15rem + .7vw, 1.65rem);
  line-height: 1.25;
  color: var(--teal-900);
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--rule);
}

.prose h3 {
  margin: 1.9rem 0 .5rem;
  font-family: "Bitter", Georgia, serif;
  font-weight: 500;
  font-size: 1.13rem;
  color: var(--rust-dark);
}

.prose p { margin: 0 0 1.15rem; }

.prose > p:first-of-type {
  font-size: 1.1875rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.prose ul, .prose ol { margin: 0 0 1.3rem; padding-left: 1.35rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--teal-500); }

.prose strong { color: var(--teal-900); }

.prose blockquote {
  margin: 1.6rem 0;
  padding: .35rem 0 .35rem 1.35rem;
  border-left: 4px solid var(--gold);
  font-family: "Bitter", Georgia, serif;
  font-style: italic;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--rule); padding: .5rem .7rem; text-align: left; }
.prose th { background: var(--paper-2); font-family: "Bitter", Georgia, serif; }

/* ---------- figures ---------- */
.hero-fig { margin: 0 0 2.2rem; }

.hero-fig img,
.fig img {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.hero-fig figcaption,
.fig figcaption {
  margin-top: .55rem;
  padding-left: .7rem;
  border-left: 3px solid var(--teal-500);
  font-size: .8125rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-faint);
}

.fig { margin: 2rem 0; max-width: var(--measure); }

.figgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.6rem;
  margin: 2.2rem 0;
  max-width: var(--measure);
}
.figgrid .fig { margin: 0; max-width: none; }

/* ---------- footer ---------- */
.foot {
  background: var(--teal-900);
  color: #b9d3d0;
  border-top: 5px solid var(--rust);
  padding: 2.4rem 0 2.6rem;
  font-size: .9375rem;
}
.foot p { margin: 0 0 .85rem; max-width: 60ch; }
.foot-lead {
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--paper);
}
.foot a { color: #8fd0cb; }
.foot a:hover, .foot a:focus-visible { color: var(--gold); }
.foot-nav { max-width: none; line-height: 2; }
.foot-c {
  margin: 1.2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .13);
  font-size: .8125rem;
  color: #7ea6a3;
}

/* ---------- back to top (progressive enhancement only) ---------- */
.totop {
  position: fixed;
  right: 1.1rem; bottom: 1.1rem;
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  background: var(--teal-900);
  color: var(--paper);
  border: 2px solid var(--gold);
  font-size: 1.05rem;
  text-decoration: none;
  z-index: 20;
}
.totop:hover, .totop:focus-visible { background: var(--rust-dark); color: #fff; }

/* ---------- wide layout ---------- */
@media (min-width: 62rem) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    gap: 3.25rem;
    align-items: start;
    padding-top: 2.75rem;
  }
  .rail {
    position: sticky;
    top: 1.75rem;
    margin-bottom: 0;
    padding-right: 1.4rem;
    border-right: 1px solid var(--rule);
  }
  .navlist { display: block; }
  .navlist li { margin-bottom: .3rem; }
  .navlist a {
    background: transparent;
    border: 0;
    border-left: 3px solid var(--rule-soft);
    padding: .28rem .7rem;
    font-weight: 400;
  }
  .navlist a:hover, .navlist a:focus-visible {
    background: var(--teal-100); border-left-color: var(--teal-500); color: var(--teal-900);
  }
  .navlist li.is-current a {
    background: transparent;
    border-left-color: var(--rust);
    color: var(--rust-dark);
    font-weight: 600;
    box-shadow: none;
  }
  .fig.gridfig { max-width: none; }
  .figgrid { max-width: none; }
}

@media (max-width: 30rem) {
  .brand { gap: .7rem; }
  .brand-mark { width: 2.6rem; height: 2.6rem; font-size: 1.45rem; border-width: 2px; }
  .brand-sub { display: none; }
  .navlist a { font-size: .875rem; padding: .3rem .6rem; }
}

/* ---------- safeguards ----------
   Content must be visible with CSS alone. If any scroll-reveal markup is ever
   introduced here, it must never leave content hidden waiting on JavaScript. */
[data-aos] { opacity: 1 !important; transform: none !important; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .rail, .foot-nav, .totop, .skip { display: none; }
  body { background: #fff; }
  .masthead { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .brand-name, .brand-sub { color: #000; }
}
