:root {
  --ink: #070707;
  --muted: #55514a;
  --paper: #f4efe6;
  --soft: #e7ded0;
  --line: #cdbf9f;
  --gold: #ad8a18;
  --gold-dark: #8e7212;
  --wine: #950000;
  --charcoal: #303236;
  --panel: #fff8eb;
  --sepia: #eadcc2;
  --sage: #d8ded2;
  --smoke: #ece8df;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(173, 138, 24, 0.16), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(149, 0, 0, 0.08), transparent 30%),
    linear-gradient(180deg, #f6f1e8 0%, #eee4d3 48%, #f7f1e7 100%);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--gold);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 36px;
}

.brand {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 1.08rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 70px;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links .active {
  font-weight: 800;
}

.search-link {
  position: relative;
  width: 26px;
  min-height: 26px;
}

.search-link::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  top: 20px;
  left: 0;
}

.search-link::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 3px;
  background: var(--ink);
  transform: rotate(45deg);
  top: 37px;
  left: 15px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 3px;
  background: transparent;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 42px;
  align-items: stretch;
  width: min(1440px, calc(100% - 64px));
  margin: 36px auto 54px;
}

.hero-photo {
  align-self: center;
  box-shadow: var(--shadow);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px 28px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
.article-body {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin: 0;
  font-size: clamp(3.2rem, 6vw, 6.7rem);
  line-height: 1.02;
}

h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4.8vw, 5rem);
  line-height: 1.08;
}

h3 {
  margin: 0 0 12px;
  font-size: 1.8rem;
  line-height: 1.15;
}

.dates {
  margin: 22px 0;
  color: var(--wine);
  font-weight: 800;
}

.hero-copy p {
  max-width: 560px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1.08rem;
  text-align: justify;
}

.hero-copy p:last-child {
  margin-bottom: 0;
}

.intro-wrap {
  padding: 44px 24px 70px;
  background:
    linear-gradient(90deg, rgba(173, 138, 24, 0.1), transparent 32%),
    var(--sepia);
}

.intro-text,
.article-body,
.publications,
.section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.intro-text {
  max-width: 1180px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.1vw, 1.9rem);
  text-align: justify;
  padding: 30px;
  background: rgba(255, 248, 235, 0.72);
  border-left: 7px solid var(--gold);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
}

.feature-banner {
  display: grid;
  place-items: center;
  min-height: 210px;
  color: #fff;
  background:
    linear-gradient(rgba(48, 50, 54, 0.62), rgba(48, 50, 54, 0.62)),
    linear-gradient(125deg, #4b4f54 0 25%, #62666b 25% 45%, #777c81 45% 70%, #aeb4bb 70% 100%);
}

.feature-banner h2 {
  color: #fff;
  font-size: clamp(4rem, 8vw, 6.2rem);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.article-section {
  padding: 42px 0 72px;
  background:
    linear-gradient(90deg, rgba(48, 50, 54, 0.05), transparent 28%),
    #f7efe1;
}

.article-body {
  max-width: 1180px;
  font-size: clamp(1.35rem, 2vw, 1.72rem);
  line-height: 1.42;
  text-align: justify;
  padding: 34px;
  background: rgba(255, 253, 248, 0.76);
  border-top: 4px solid var(--gold);
  border-bottom: 4px solid var(--gold);
}

.article-body p {
  margin: 0 0 24px;
}

.section-title {
  display: grid;
  place-items: center;
  min-height: 140px;
  background: var(--soft);
}

.section-title h2 {
  color: var(--wine);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  text-decoration: underline;
}

.section-title.angled-title {
  min-height: 210px;
  color: #fff;
  background:
    linear-gradient(122deg, rgba(35, 37, 40, 0.96) 0 24%, rgba(57, 60, 64, 0.96) 24% 48%, rgba(75, 79, 84, 0.96) 48% 74%, rgba(96, 101, 107, 0.96) 74% 100%);
}

.section-title.angled-title h2 {
  color: #fff;
  font-size: clamp(3.2rem, 6vw, 5rem);
  text-decoration: none;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.section,
.publications {
  padding: 58px 0 72px;
}

.photos {
  background:
    linear-gradient(135deg, rgba(173, 138, 24, 0.14), transparent 34%),
    var(--sage);
  width: 100%;
  max-width: none;
  padding-left: max(24px, calc((100% - 1180px) / 2));
  padding-right: max(24px, calc((100% - 1180px) / 2));
}

.stories {
  background:
    linear-gradient(135deg, rgba(149, 0, 0, 0.08), transparent 38%),
    #efe2d2;
  width: 100%;
  max-width: none;
  padding-left: max(24px, calc((100% - 1180px) / 2));
  padding-right: max(24px, calc((100% - 1180px) / 2));
}

.publication-card {
  margin-bottom: 28px;
}

.publication-head {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 12px 20px;
  border: 0;
  border-bottom: 1px solid #777;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.publication-content {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 0.52fr);
  gap: 34px;
  align-items: center;
  padding: 28px 12px 18px;
}

.book-cover {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.14)),
    url("assets/memorial-hero.png");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}

.gato-symbol {
  align-self: center;
  justify-self: center;
  width: min(360px, 100%);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

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

.publication-content p {
  color: var(--muted);
  font-size: 1.18rem;
  text-align: justify;
}

.gato-negro-section {
  width: 100%;
  max-width: none;
  padding-left: max(24px, calc((100% - 1180px) / 2));
  padding-right: max(24px, calc((100% - 1180px) / 2));
  background:
    radial-gradient(circle at 8% 0%, rgba(173, 138, 24, 0.18), transparent 30%),
    linear-gradient(90deg, rgba(173, 138, 24, 0.1), transparent 35%),
    #f3ead8;
}

.books-block {
  margin: 38px 0 44px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(48, 50, 54, 0.08), transparent 42%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
}

.books-heading {
  max-width: 780px;
  margin-bottom: 24px;
}

.books-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  text-align: justify;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.book-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(220px, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  background: #fffaf0;
  border: 1px solid var(--line);
}

.book-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
  padding: 24px 20px;
  color: #fff;
  overflow: hidden;
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.12);
}

.book-art::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.book-art::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  pointer-events: none;
}

.book-art-one {
  background:
    linear-gradient(145deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.38)),
    linear-gradient(135deg, #ad8a18, #5d4812 52%, #1f1d18);
}

.book-art-two {
  background:
    linear-gradient(145deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.34)),
    linear-gradient(135deg, #303236, #6e1f1f 55%, #ad8a18);
}

.book-author {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.book-art strong {
  position: relative;
  z-index: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
}

.book-art span:last-child {
  position: relative;
  z-index: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.book-info h4 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.book-info p {
  margin: 0;
  color: var(--muted);
  text-align: justify;
}

.read-book-button,
.close-reader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid var(--gold-dark);
  color: #fff;
  background: var(--gold-dark);
  font-weight: 800;
  cursor: pointer;
}

.read-book-button:hover,
.close-reader:hover {
  background: var(--wine);
  border-color: var(--wine);
}

.book-reader {
  margin-top: 30px;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(173, 138, 24, 0.1), transparent 35%),
    #efe1c9;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reader-toolbar h3 {
  margin-bottom: 0;
}

.reader-toolbar .close-reader {
  flex: 0 0 auto;
  margin-top: 0;
}

.reader-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.reader-page {
  min-height: 320px;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(173, 138, 24, 0.08), transparent 26%),
    #fffdf8;
  border: 1px solid #e5dccb;
}

.reader-page span {
  display: block;
  margin-bottom: 12px;
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reader-page h4 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.reader-page p {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  line-height: 1.62;
  text-align: justify;
}

.poems-accordion {
  margin-top: 48px;
}

.poems-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: 100%;
  min-height: 92px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(149, 0, 0, 0.1), transparent 40%),
    linear-gradient(135deg, var(--sepia), var(--sage));
  cursor: pointer;
  text-align: left;
}

.poems-toggle small {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.poems-toggle strong {
  display: block;
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.toggle-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  color: #fff;
  background: var(--gold-dark);
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.poems-toggle[aria-expanded="true"] .toggle-mark {
  background: var(--wine);
}

.poem-gallery {
  column-count: 3;
  column-gap: 18px;
  margin-top: 34px;
}

.poem-tile {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  overflow: hidden;
  background: #fff8ec;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
  break-inside: avoid;
}

.poem-tile img {
  display: block;
  width: 100%;
  height: auto;
}

.poem-tile figcaption {
  padding: 12px 14px 14px;
  color: var(--wine);
  background: #fff2dd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card,
.upload-panel,
.story-form,
.story-card {
  background:
    linear-gradient(135deg, rgba(173, 138, 24, 0.1), transparent 45%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.work-card {
  min-height: 230px;
  padding: 26px;
}

.work-card.featured {
  color: #fff;
  background: var(--charcoal);
  border-color: var(--charcoal);
}

.work-type {
  margin: 0 0 14px;
  color: var(--wine);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.work-card p {
  margin: 0;
  color: var(--muted);
  text-align: justify;
}

.work-card.featured .work-type,
.work-card.featured blockquote {
  color: #fff;
}

blockquote {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.45;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.upload-panel,
.story-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
  padding: 24px;
  margin-bottom: 30px;
}

.upload-panel label,
.field-row label {
  font-weight: 800;
}

.upload-panel p {
  margin: -8px 0 0;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf8;
}

input:focus,
textarea:focus {
  border-color: var(--gold-dark);
  outline: 3px solid rgba(173, 138, 24, 0.18);
}

.field-row {
  display: grid;
  gap: 7px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--gold-dark);
}

.button.primary:hover {
  background: var(--wine);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-width: 980px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e3d2ad;
  box-shadow: var(--shadow);
}

.photo-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-open::after {
  content: "Ver foto";
  position: absolute;
  inset: auto 12px 12px 12px;
  padding: 8px 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 0.9rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.photo-card:hover .photo-open::after,
.photo-open:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

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

.remove-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.viewer-open {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 12px;
  padding: 42px 24px;
  background: rgba(0, 0, 0, 0.88);
}

.photo-viewer[hidden] {
  display: none;
}

.viewer-frame {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 0;
}

.viewer-frame img {
  display: block;
  max-width: min(100%, 1180px);
  max-height: calc(100vh - 150px);
  object-fit: contain;
  background: #111;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

.viewer-frame figcaption {
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.viewer-close,
.viewer-nav {
  border: 0;
  color: #fff;
  background: rgba(173, 138, 24, 0.92);
  cursor: pointer;
}

.viewer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 800;
}

.viewer-nav {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 2.8rem;
  line-height: 1;
}

.viewer-nav:hover,
.viewer-close:hover {
  background: var(--wine);
}

.stories-list {
  display: grid;
  gap: 16px;
}

.story-card {
  padding: 24px;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
  color: var(--gold-dark);
  font-size: 0.95rem;
  font-weight: 800;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  text-align: justify;
}

.story-actions {
  margin-top: 18px;
}

.text-button {
  border: 0;
  color: var(--wine);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.empty-state {
  margin: 12px 0 0;
  color: var(--muted);
  font-style: italic;
}

.footer {
  padding: 34px 16px;
  color: #fff;
  text-align: center;
  background: var(--charcoal);
}

.footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .nav {
    padding: 0 20px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 78px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 18px;
    background: var(--gold);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    min-height: 46px;
  }

  .search-link {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    width: min(100%, calc(100% - 32px));
    margin-top: 24px;
  }

  .hero-copy {
    padding: 8px 0 20px;
  }

  .publication-content,
  .book-grid,
  .reader-pages,
  .works-grid {
    grid-template-columns: 1fr;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .book-item {
    grid-template-columns: minmax(150px, 0.5fr) minmax(220px, 1fr);
  }

  .poem-gallery {
    column-count: 2;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 1.2rem;
  }

  .feature-banner {
    min-height: 180px;
  }

  .feature-banner h2 {
    font-size: 3.3rem;
  }

  .intro-text,
  .article-body,
  .publications,
  .section {
    width: min(100%, calc(100% - 32px));
  }

  .article-body,
  .intro-text {
    text-align: left;
  }

  .button {
    width: 100%;
  }

  .books-block,
  .book-item {
    padding: 18px;
  }

  .book-item {
    grid-template-columns: 1fr;
  }

  .book-art {
    min-height: 260px;
  }

  .reader-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .reader-toolbar .close-reader {
    width: 100%;
  }

  .book-reader,
  .reader-page {
    padding: 18px;
  }

  .poems-toggle {
    align-items: flex-start;
    padding: 16px;
  }

  .toggle-mark {
    width: 38px;
    height: 38px;
    font-size: 1.55rem;
  }

  .poem-gallery {
    column-count: 1;
  }

  .photo-viewer {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "frame frame"
      "prev next";
    padding: 58px 14px 18px;
  }

  .viewer-frame {
    grid-area: frame;
  }

  .viewer-prev {
    grid-area: prev;
    justify-self: end;
  }

  .viewer-next {
    grid-area: next;
    justify-self: start;
  }

  .viewer-nav {
    width: 50px;
    height: 50px;
  }
}
