/* ============================================================
   Robillard Family History — default.css
   Refactored 2026 | Warm scrapbook theme, fully responsive
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* --- CSS Variables (edit palette here) --- */
:root {
  --cream:        #F4F1E8;
  --cream-card:   #EEE9DE;
  --cream-border: #DDD5C7;
  --walnut:       #2E5B8A;
  --mid-brown:    #5B8DB8;
  --gold:         #C8943A;
  --gold-hover:   #A87A2D;
  --footer-dark:  #1B3A52;
  --text-body:    #3A4A5A;
  --text-light:   #F4F1E8;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lato', 'Lucida Sans Unicode', sans-serif;

  --radius:       4px;
  --shadow:       0 2px 8px rgba(46,91,138,0.12);
  --transition:   0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Base --- */
html { font-size: 62.5%; scroll-behavior: smooth; }

body {
  background-color: #7A8FA3;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 12px
  );
  color: var(--text-body);
  font: 400 1.6rem/1.7 var(--font-body);
  min-height: 100vh;
}

a             { color: var(--gold-hover); text-decoration: none; transition: color var(--transition); }
a:hover       { color: var(--walnut); text-decoration: underline; }
img           { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--walnut);
  line-height: 1.25;
}
h1 { font-size: 2.4rem; margin-bottom: 0.4rem; }
h2 { font-size: 2.0rem; margin-bottom: 0.4rem; }
h3 { font-size: 1.7rem; margin-bottom: 0.3rem; }

p, ul, ol, blockquote, code {
  margin-bottom: 1.4rem;
}
ul, ol { padding-left: 1.8rem; }
li { margin-bottom: 0.3rem; }

blockquote {
  border-left: 4px solid var(--gold);
  padding: 0.8rem 1.4rem;
  background: var(--cream-card);
  color: var(--mid-brown);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.7rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

code, pre {
  background: #FFF8EC;
  border: 1px solid var(--cream-border);
  border-left: 5px solid var(--gold);
  color: var(--walnut);
  font-size: 1.4rem;
  padding: 1rem 1.4rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Container --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 40px rgba(0,0,0,0.35);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--walnut);
  background-image: linear-gradient(160deg, #3A7BA8 0%, #1B3A52 100%);
  padding: 2.8rem 3.2rem 2.4rem;
  position: relative;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.site-title span {
  display: block;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-body);
  margin-bottom: 0.4rem;
}

/* Torn-paper SVG divider */
.torn-edge {
  width: 100%;
  display: block;
  line-height: 0;
}
.torn-edge svg {
  width: 100%;
  height: 28px;
  display: block;
}

/* ============================================================
   TOP NAVIGATION
   ============================================================ */
.top-nav {
  background: var(--mid-brown);
  position: relative;
}

.top-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.top-nav__list li a {
  display: block;
  padding: 1.1rem 1.8rem;
  color: var(--cream);
  font: 700 1.3rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.top-nav__list li a:hover,
.top-nav__list li a.active {
  background: rgba(255,255,255,0.1);
  border-bottom-color: var(--gold);
  color: #fff;
  text-decoration: none;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1.2rem 1.6rem;
  color: var(--cream);
  font-size: 2.2rem;
  line-height: 1;
  width: 100%;
  text-align: left;
}

/* ============================================================
   MAIN CONTENT AREA  (CSS Grid)
   ============================================================ */
.main {
  display: grid;
  grid-template-columns: 1fr 230px;
  grid-template-areas: "content sidebar";
  gap: 0;
  padding: 2.8rem 2.4rem 3.2rem;
  align-items: start;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content {
  grid-area: content;
  padding-right: 3.2rem;
  min-width: 0; /* prevent grid blowout */
}

/* Journal/entry card */
.entry {
  margin-bottom: 3.2rem;
  padding-bottom: 2.8rem;
  border-bottom: 1px solid var(--cream-border);
}
.entry:last-child {
  border-bottom: none;
}

.entry__meta {
  font-size: 1.2rem;
  color: var(--gold-hover);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-body);
  margin-bottom: 0.8rem;
}

.entry__title {
  font-size: 2.0rem;
  margin-bottom: 0.6rem;
}

/* Photo gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.gallery__item {
  background: var(--cream-card);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.gallery__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(74,55,40,0.18);
}
.gallery__item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.gallery__caption {
  padding: 0.6rem 0.8rem;
  font-size: 1.2rem;
  color: var(--mid-brown);
  font-style: italic;
}

/* Placeholder for missing photos */
.gallery__placeholder {
  width: 100%;
  height: 140px;
  background: var(--cream-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mid-brown);
  font-size: 3.2rem;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  grid-area: sidebar;
}

.sidenav-group {
  margin-bottom: 1.6rem;
  background: var(--cream-card);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidenav-group__title {
  background: var(--mid-brown);
  color: var(--cream);
  font: 700 1.25rem/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 1.2rem;
  margin: 0;
}

.sidenav-group__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidenav-group__list li {
  margin: 0;
  border-top: 1px solid var(--cream-border);
}
.sidenav-group__list li:first-child {
  border-top: none;
}
.sidenav-group__list li a {
  display: block;
  padding: 0.75rem 1.2rem;
  font-size: 1.3rem;
  color: var(--text-body);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidenav-group__list li a:hover {
  background: var(--cream-border);
  color: var(--walnut);
  text-decoration: none;
}
.sidenav-group__list li a.active {
  background: var(--gold);
  color: var(--walnut);
  font-weight: 700;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-size: 1.25rem;
  color: var(--mid-brown);
  padding: 1rem 2.4rem;
  background: var(--cream-card);
  border-bottom: 1px solid var(--cream-border);
}
.breadcrumb a { color: var(--gold-hover); }
.breadcrumb span { margin: 0 0.5rem; color: var(--gold); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--footer-dark);
  color: #C8B89A;
  font-size: 1.25rem;
  text-align: center;
  padding: 1.8rem 2rem;
  line-height: 1.8;
}
.site-footer a { color: var(--gold); }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* ============================================================
   UTILITIES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 760px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "content"
      "sidebar";
    padding: 2rem 1.6rem 2.4rem;
  }
  .content { padding-right: 0; }
  .sidebar { margin-top: 1.6rem; }

  .top-nav__list { display: none; flex-direction: column; }
  .top-nav__list.open { display: flex; }
  .nav-toggle { display: block; }

  .site-header { padding: 2rem 1.8rem 1.6rem; }
}

/* Mobile */
@media (max-width: 480px) {
  html { font-size: 58%; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .breadcrumb { padding: 0.8rem 1.6rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}
