:root {
  --ink: #27251f;
  --navy: #25323b;
  --sea: #375b68;
  --paper: #f6f2e9;
  --yellow: #fff7a8;
  --line: #c9c1b0;
  --link: #174f75;
}

* { box-sizing: border-box; }

html { background: #d8d2c7; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.25)),
    repeating-linear-gradient(90deg, #d7d0c3 0, #d7d0c3 2px, #dcd6cb 2px, #dcd6cb 6px);
  font-family: Georgia, "Times New Roman", serif;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #8a3d1f; }

.site-shell {
  width: min(100%, 1050px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 28px rgba(31, 35, 35, .28);
}

.welcome-banner {
  margin: 0;
  padding: 13px 18px 11px;
  color: #fff;
  background: #9d9d9d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.hero { background: #fff; }
.hero img { display: block; width: 100%; height: auto; }

.main-nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  background: var(--navy);
  border-top: 4px solid #e8e0cf;
  border-bottom: 1px solid #0f191e;
}

.main-nav a {
  flex: 1 1 auto;
  padding: 11px 3px 10px;
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.16);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(.58rem, .9vw, .72rem);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.main-nav a:hover { background: var(--sea); color: #fff; }

.content-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 230px;
  gap: 20px;
  padding: 22px;
  align-items: start;
}

.side-card {
  padding: 12px;
  border: 1px solid #d4c985;
  box-shadow: 0 2px 8px rgba(56, 52, 37, .12);
}

.side-card img { display: block; width: 100%; height: auto; margin-bottom: 12px; }
.yellow-card, .stories-card { background: var(--yellow); }

.side-card h2 {
  margin: 18px 0 8px;
  color: #323228;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .93rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.side-card ul { margin: 0; padding: 0; list-style: none; }
.side-card li, .side-card p { margin: 0 0 9px; font-size: .96rem; line-height: 1.35; }

.latest-list li { padding-left: 12px; border-left: 3px solid #d5a93c; }

.welcome-card {
  min-height: 570px;
  padding: 25px 28px;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
}

.welcome-card p { font-size: 1.08rem; line-height: 1.58; }
.welcome-card > p { text-align: center; }
.welcome-card .lead { margin-top: 0; font-size: 1.25rem; color: #2e535e; }

.book-feature { margin: 34px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.book-feature img { display: block; width: min(100%, 420px); height: auto; margin: 0 auto 18px; }
.book-feature h2 { margin: 0 0 6px; color: #2e535e; font-size: 1.22rem; }
.book-feature p { margin: 0 0 8px; font-size: 1rem; line-height: 1.45; }
.book-link { font-weight: 700; }

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  color: #e9edf0;
  background: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .9rem;
}

.admin-link { color: #fff; font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: #fff; }

.admin-shell { width: min(900px, calc(100% - 32px)); margin: 36px auto; }
.admin-header { display: flex; justify-content: space-between; gap: 30px; align-items: center; margin-bottom: 24px; }
.admin-header h1 { margin: 4px 0 8px; font-size: clamp(2rem, 5vw, 3.4rem); color: #233d46; }
.admin-header p { max-width: 620px; line-height: 1.5; }
.eyebrow { margin: 0; color: #8a3d1f; font-family: Arial, sans-serif; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.preview-button, button { display: inline-flex; justify-content: center; border: 0; border-radius: 5px; padding: 12px 18px; color: white; background: #315f6e; font: 700 .95rem Arial, sans-serif; text-decoration: none; cursor: pointer; }
.preview-button:hover, button:hover { color: #fff; background: #244b58; }
.notice { padding: 13px 16px; background: #e3efd9; border: 1px solid #aac793; border-radius: 5px; }
.admin-card { margin: 20px 0; padding: 24px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(30,35,35,.09); }
.admin-card h2 { margin-top: 0; color: #2e535e; }
.admin-card form { display: grid; gap: 8px; }
.admin-card label { margin-top: 8px; font: 700 .9rem Arial, sans-serif; }
.admin-card input, .admin-card textarea { width: 100%; border: 1px solid #a9a398; border-radius: 4px; padding: 11px 12px; background: #fffef9; color: var(--ink); font: 1rem Georgia, serif; }
.admin-card form button { justify-self: start; margin-top: 10px; }
.admin-items { display: grid; gap: 8px; margin-bottom: 20px; }
.admin-item { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 12px; background: #f5f1e8; border: 1px solid #ddd5c6; }
.admin-item small { display: block; max-width: 600px; margin-top: 5px; color: #655f56; overflow-wrap: anywhere; }
.danger-button { padding: 8px 12px; background: #8a3d34; }
.demo-note { color: #5f574d; font-style: italic; line-height: 1.5; }

.contact-shell { width: min(760px, calc(100% - 32px)); margin: 36px auto; }
.back-link { display: inline-block; margin-bottom: 18px; font-family: Arial, sans-serif; font-weight: 700; }
.contact-card { padding: clamp(24px, 6vw, 52px); background: #fff; border: 1px solid var(--line); box-shadow: 0 5px 20px rgba(30,35,35,.12); }
.contact-card h1 { margin: 5px 0 18px; color: #233d46; font-size: clamp(2.2rem, 6vw, 3.8rem); }
.contact-card > p { font-size: 1.1rem; line-height: 1.6; }
.contact-card dl { margin: 28px 0; border-top: 1px solid var(--line); }
.contact-card dl div { display: grid; grid-template-columns: 130px 1fr; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.contact-card dt { font: 700 .9rem Arial, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.contact-card dd { margin: 0; font-size: 1.08rem; }
.contact-card .privacy-note { padding: 14px 16px; background: #f3efe5; font-size: .98rem; }

.album-shell { width: min(1120px, calc(100% - 28px)); margin: 24px auto 42px; }
.album-header { padding: 13px clamp(20px, 3.5vw, 34px) 15px; color: #eef4f5; background: linear-gradient(135deg, #203944, #466a73); border-bottom: 4px solid #d6b45b; }
.album-header .back-link { margin-bottom: 6px; color: #fff; }
.album-kicker { margin: 5px 0 3px; color: #efd888; font: 800 .78rem Arial, sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.album-header h1 { margin: 0 0 7px; color: #fff; font-size: clamp(2rem, 5.5vw, 3.5rem); font-weight: 400; line-height: .98; }
.album-intro { max-width: 720px; margin: 0; font-size: 1rem; line-height: 1.35; }
.sample-notice { max-width: 720px; margin: 22px 0 0; padding: 10px 12px; color: #273840; background: #fff3bd; border-radius: 4px; font: 700 .88rem Arial, sans-serif; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 300px)); justify-content: start; gap: 18px; padding: 24px; background: #ede8dd; }
.photo-grid figure { width: 100%; margin: 0; padding: 10px; background: #fff; box-shadow: 0 4px 13px rgba(23,31,31,.17); }
.photo-grid a { display: block; aspect-ratio: 4 / 3; background: #182126; overflow: hidden; }
.photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.photo-grid a:hover img { transform: scale(1.025); }
.photo-grid figcaption { height: 47px; padding: 9px 4px 2px; overflow: hidden; color: #433e36; font-size: .98rem; line-height: 1.35; }
.photo-lightbox {
  width: min(94vw, 1100px);
  max-height: 94vh;
  padding: 42px 18px 18px;
  color: #fff;
  background: #17242a;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 15px 55px rgba(0,0,0,.55);
}
.photo-lightbox::backdrop { background: rgba(8, 14, 17, .82); }
.photo-lightbox img { display: block; width: min(100%, 960px); height: min(70vh, 720px); margin: 0 auto; object-fit: contain; background: #0e171b; }
.photo-lightbox p { max-width: 900px; margin: 16px auto 2px; font-size: 1.05rem; line-height: 1.5; text-align: center; }
.photo-lightbox-close {
  position: absolute;
  top: 6px;
  right: 9px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  background: transparent;
  font: 400 2rem/1 Arial, sans-serif;
}
.photo-lightbox-close:hover { background: rgba(255,255,255,.12); }
.photo-lightbox-zoom {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 3;
  padding: 7px 12px;
  transform: translateX(-50%);
  color: #fff;
  background: #315f6e;
  font-size: .82rem;
}
.photo-lightbox-zoom:hover { background: #47798a; }
.story-lightbox img { width: min(100%, 1200px); height: min(86vh, 1000px); cursor: zoom-in; }
.story-lightbox.is-zoomed { overflow: auto; }
.story-lightbox.is-zoomed img {
  width: 165%;
  max-width: none;
  height: auto;
  max-height: none;
  cursor: zoom-out;
}
.photo-lightbox-previous,
.photo-lightbox-next {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 70px;
  padding: 0;
  transform: translateY(-50%);
  color: #fff;
  background: rgba(14, 23, 27, .72);
  font: 400 3.2rem/1 Arial, sans-serif;
}
.photo-lightbox-previous { left: 8px; }
.photo-lightbox-next { right: 8px; }
.photo-lightbox-previous:hover,
.photo-lightbox-next:hover { background: rgba(49, 95, 110, .92); }
.album-footer { display: flex; justify-content: space-between; padding: 18px 24px; color: #fff; background: var(--navy); }
.album-footer a { color: #fff; }

.albums-shell { width: min(1000px, calc(100% - 28px)); margin: 24px auto 44px; }
.albums-header { padding: 18px clamp(22px, 5vw, 42px) 20px; background: #fff; border-top: 6px solid #355b68; border-bottom: 1px solid var(--line); }
.albums-header .back-link { margin-bottom: 10px; }
.albums-header .album-kicker { margin: 5px 0 2px; color: #8a3d1f; }
.albums-header h1 { margin: 0 0 7px; color: #233d46; font-size: clamp(2.35rem, 5vw, 3.65rem); font-weight: 400; line-height: 1; }
.albums-header > p:last-child { max-width: 680px; margin: 0; font-size: 1.04rem; line-height: 1.4; }
.album-list { display: grid; gap: 18px; padding: 24px; background: #ede8dd; }
.album-card { display: grid; grid-template-columns: minmax(220px, 38%) 1fr; gap: 24px; padding: 14px; background: #fff; border: 1px solid #d2cabd; box-shadow: 0 3px 12px rgba(30,35,35,.1); }
.album-card-image { display: block; background: #172027; }
.album-card-image img { display: block; width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.album-card > div { align-self: center; padding: 10px 18px 10px 0; }
.album-card span { color: #8a3d1f; font: 800 .78rem Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.album-card h2 { margin: 6px 0 9px; font-size: 2.2rem; font-weight: 400; }
.album-card h2 a { color: #2e535e; text-decoration: none; }
.album-card p { font-size: 1.04rem; line-height: 1.5; }
.open-album { font-weight: 700; }
.empty-state { padding: 45px 22px; text-align: center; background: #fff; border: 1px solid var(--line); }

.stories-shell { width: min(1040px, calc(100% - 28px)); margin: 24px auto 44px; background: #ede8dd; }
.stories-header { padding: 24px clamp(24px, 5vw, 48px) 28px; background: #fff; border-top: 7px solid #355b68; border-bottom: 1px solid var(--line); }
.stories-header .back-link { margin-bottom: 13px; }
.stories-header .eyebrow { margin: 2px 0 4px; }
.stories-header h1 { max-width: 850px; margin: 0 0 9px; color: #233d46; font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 400; line-height: 1; }
.stories-header > p:last-child { margin: 0; font-size: 1.08rem; line-height: 1.45; }
.story-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; padding: 26px; }
.story-book { display: grid; grid-template-rows: 300px 1fr; overflow: hidden; background: #fff; border: 1px solid #d2cabd; box-shadow: 0 5px 15px rgba(30,35,35,.14); }
.story-cover { display: flex; align-items: center; justify-content: center; overflow: hidden; color: #f7f0dc; background: linear-gradient(145deg, #294a55, #172c34); text-decoration: none; }
.story-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-cover span { max-width: 80%; padding: 22px; border: 1px solid rgba(255,255,255,.35); font-size: 1.8rem; line-height: 1.12; text-align: center; }
.story-book-copy { padding: 19px 20px 22px; }
.story-meta { margin: 0 0 6px; color: #8a3d1f; font: 800 .76rem Arial, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.story-book h2 { margin: 0 0 9px; font-size: 1.75rem; font-weight: 400; line-height: 1.08; }
.story-book h2 a { color: #2e535e; text-decoration: none; }
.story-book-copy > p:not(.story-meta) { min-height: 66px; font-size: .98rem; line-height: 1.45; }
.open-story { font-weight: 700; }
.story-shell { width: min(960px, calc(100% - 28px)); margin: 24px auto 44px; background: #f6f2e9; box-shadow: 0 5px 22px rgba(30,35,35,.16); }
.story-header { padding: 17px clamp(22px, 4vw, 38px) 20px; color: #eef4f5; background: linear-gradient(135deg, #203944, #466a73); border-bottom: 4px solid #d6b45b; }
.story-header .back-link {
  margin-bottom: 14px;
  color: #fff;
  font-size: .78rem;
  font-weight: 500;
  opacity: .9;
}
.story-header .eyebrow { margin: 0 0 3px; color: #efd888; }
.story-header h1 { max-width: 100%; margin: 0 0 7px; overflow-wrap: anywhere; color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 400; line-height: 1.04; }
.story-byline {
  margin: 0 0 8px;
  font: 500 .84rem/1.35 Arial, Helvetica, sans-serif;
  letter-spacing: .01em;
}
.story-intro {
  width: 100%;
  max-width: none;
  margin: 16px 0 0;
  font: 400 .88rem/1.5 Arial, Helvetica, sans-serif;
}
.story-reading { padding: clamp(24px, 6vw, 58px); background: #fffefb; }
.story-cover-link { display: block; width: min(100%, 760px); margin: 0 auto 48px; cursor: zoom-in; }
.story-reading-cover { display: block; width: 100%; max-height: 760px; margin: 0 auto; object-fit: contain; box-shadow: 0 6px 20px rgba(30,35,35,.2); }
.story-text { max-width: 780px; margin: 0 auto; color: #292721; font-size: .96rem; line-height: 1.2; }
.story-text h2 { margin: 22pt 0 8pt; color: #315763; font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
.story-text h2:first-child { margin-top: 0; }
.story-text p { margin: 0 0 9pt; }
.story-text p:last-child { margin-bottom: 0; }
.story-lead { margin: 0 0 38px; padding: 3px 0 3px 18px; color: #4d4941; border-left: 3px solid #d6b45b; font-size: 1rem; font-style: italic; line-height: 1.35; }
.story-lead p { margin-bottom: 11pt; }
.story-text > p:first-child { margin-bottom: 38px; padding-left: 18px; color: #4d4941; border-left: 3px solid #d6b45b; font-style: italic; line-height: 1.35; }
.story-inline-photo { width: min(100%, 620px); margin: 30px auto 40px; text-align: center; }
.story-inline-photo a { display: block; cursor: zoom-in; }
.story-inline-photo img { display: block; width: 100%; max-height: 720px; object-fit: contain; background: #f3efe6; box-shadow: 0 4px 15px rgba(30,35,35,.16); }
.story-inline-photo figcaption { margin-top: 8px; color: #5c554b; font: italic .86rem/1.35 Georgia, serif; }
.story-pdf { max-width: 690px; margin: 30px auto 0; padding: 22px; text-align: center; background: #f0eadc; border: 1px solid var(--line); }
.story-pdf p { margin-top: 0; }
.story-admin-cover { display: block; width: min(220px, 100%); max-height: 280px; object-fit: cover; border: 1px solid var(--line); }

.admin-body { min-height: 100vh; background: #eee9df; font-family: Arial, Helvetica, sans-serif; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px max(20px, calc((100vw - 1040px) / 2)); color: #fff; background: #233d46; }
.admin-topbar a { color: #fff; font-weight: 700; text-decoration: none; }
.admin-topbar nav { display: flex; gap: 18px; }
.admin-shell { width: min(1040px, calc(100% - 30px)); margin: 30px auto 60px; }
.login-shell { width: min(480px, calc(100% - 30px)); margin: 8vh auto; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.admin-heading h1, .login-shell h1 { margin: 4px 0; color: #233d46; font: 400 clamp(2.2rem, 6vw, 4rem) Georgia, serif; }
.admin-card { margin: 20px 0; padding: 24px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(30,35,35,.09); }
.admin-card h2 { margin-top: 0; color: #2e535e; font: 400 1.6rem Georgia, serif; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stack-form, .login-shell form { display: grid; gap: 9px; }
.stack-form label, .login-shell label, .photo-editor label { margin-top: 8px; font-weight: 700; }
.stack-form input, .stack-form textarea, .login-shell input, .photo-editor input { width: 100%; padding: 11px 12px; color: var(--ink); background: #fffef9; border: 1px solid #a9a398; border-radius: 4px; font: 1rem Georgia, serif; }
.stack-form small { color: #696158; }
.stack-form hr { width: 100%; margin: 18px 0; border: 0; border-top: 1px solid var(--line); }
.checkbox { display: flex; align-items: center; gap: 9px; }
.checkbox input { width: auto; }
.button, button { display: inline-flex; width: fit-content; justify-content: center; padding: 12px 18px; color: #fff; background: #315f6e; border: 0; border-radius: 5px; font: 700 .95rem Arial, sans-serif; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { color: #fff; background: #244b58; }
.button.secondary { color: #315f6e; background: #e6ecec; }
.danger-zone { border-color: #c98f86; }
.button.danger, button.danger { background: #923b32; }
.button.danger:hover, button.danger:hover { background: #722b25; }
.notice { padding: 13px 16px; background: #e3efd9; border: 1px solid #aac793; border-radius: 5px; }
.error-notice { padding: 13px 16px; color: #6b251e; background: #f8ded8; border: 1px solid #d6a198; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; text-align: left; border-bottom: 1px solid #ddd5c6; }
td small { display: block; margin-top: 4px; color: #756d63; }
.photo-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.photo-editor article { padding: 10px; background: #f5f1e8; border: 1px solid #d8d0c2; }
.photo-editor img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #1b252a; }
.photo-editor label { display: block; font-size: .85rem; }
.story-photo-marker { display: inline-block; margin: 0 0 8px; padding: 5px 8px; color: #fff; background: #315f6e; border-radius: 4px; font: 700 .82rem Arial, sans-serif; }
.delete-link { display: inline-block; margin-top: 10px; color: #8a3028; font-weight: 700; }

@media (max-width: 820px) {
  .content-grid { grid-template-columns: 1fr; }
  .welcome-card { order: -1; min-height: auto; }
  .side-card { max-width: none; }
  .side-card img { width: min(220px, 100%); }
  .album-card { grid-template-columns: 1fr; }
  .album-card > div { padding: 8px; }
  .admin-grid { grid-template-columns: 1fr; }
  .photo-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .main-nav { display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
  .main-nav a { border-bottom: 1px solid rgba(255,255,255,.13); }
  .content-grid { padding: 12px; gap: 12px; }
  .welcome-card { padding: 20px; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-item { align-items: flex-start; flex-direction: column; }
  .photo-grid { grid-template-columns: minmax(0, 300px); padding: 12px; gap: 12px; }
  .photo-lightbox-previous,
  .photo-lightbox-next { width: 40px; height: 58px; font-size: 2.7rem; }
  .story-shelf { grid-template-columns: 1fr; padding: 14px; }
  .story-book { grid-template-rows: 270px 1fr; }
  .story-reading { padding: 24px 19px; }
  .admin-topbar, .admin-heading { align-items: flex-start; flex-direction: column; }
  .photo-editor { grid-template-columns: 1fr; }
}
