/* ==========================================================
   Gabriela Noemi Villalba Marecos — site styles
   Warm & personal: cream paper, terracotta accent, serif voice
   ========================================================== */

@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400&display=swap");

:root {
  --bg: #f8f2ea;
  --surface: #fffcf8;
  --ink: #2f2622;
  --muted: #6e5f56;
  --accent: #a14a25;          /* terracotta */
  --accent-deep: #7e3819;
  --accent-soft: #f4e4d6;
  --sage: #6f7d62;
  --line: #e8dccf;
  --shadow: 0 1px 2px rgba(80, 45, 25, 0.05), 0 8px 28px rgba(80, 45, 25, 0.07);

  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: "Nunito Sans", "Segoe UI", Arial, sans-serif;
  --radius: 14px;
}

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

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
}

/* ---------- Header & navigation ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 242, 234, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 700px) {
  header {
    position: static;
  }
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  list-style: none;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  max-width: 980px;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

nav ul li a:hover,
nav ul li a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

nav ul li a.active {
  background: var(--accent);
  color: #fff;
}

/* ---------- Main container ---------- */

.container {
  max-width: 820px;
  margin: 2.5rem auto 4rem;
  padding: 2.75rem 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 700px) {
  .container {
    margin: 1rem 0.75rem 2.5rem;
    padding: 1.75rem 1.25rem;
  }
}

/* ---------- Typography ---------- */

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.25;
  color: var(--accent-deep);
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  text-align: center;
  margin: 0.75rem 0 1.25rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 0.9rem;
}

/* small hand-drawn-feel underline under section titles */
h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: 0.45rem;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.55;
}

h3 {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
  margin: 1.9rem 0 0.6rem;
}

section:first-child > h2:first-child,
main > h2:first-child {
  margin-top: 0.5rem;
}

p {
  margin: 0 0 1.05rem;
}

strong {
  font-weight: 700;
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(161, 74, 37, 0.35);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--accent-deep);
  text-decoration-color: currentColor;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: var(--accent);
}

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.5rem 0;
}

blockquote {
  margin: 1.75rem 0;
  padding: 0.9rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent-deep);
}

em {
  color: var(--muted);
}

/* ---------- Home ---------- */

.profile-pic {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: cover;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 6px 20px rgba(80, 45, 25, 0.15);
}

.profile-pic + h1 {
  margin-top: 1.25rem;
}

/* ---------- Research ---------- */

.pub-list {
  list-style: none;
  padding-left: 0;
}

.pub-item {
  margin: 0 0 1.1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: #fffaf4;
}

.citation strong {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
}

.citation .summary {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin: 0.35rem 0.25rem 0 0.25rem;
  padding: 0.1rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.tag:hover {
  background: var(--accent);
  color: #fff;
}

/* ---------- PhD Journey: milestones ---------- */

.section-intro {
  color: var(--muted);
  font-style: italic;
}

.milestone-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.milestone-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf4;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.milestone-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.milestone-card h3 {
  margin: 0.25rem 0 0.25rem;
  font-style: normal;
  color: var(--accent-deep);
}

.milestone-number {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.45;
}

.milestone-meta {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--sage);
  font-weight: 600;
}

.milestone-card blockquote {
  margin: 0.5rem 0 1rem;
  padding: 0 0 0 0.9rem;
  background: none;
  font-size: 0.98rem;
  color: var(--muted);
}

.milestone-button {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

/* ==========================================================
   LETRAS — literary pages (poems, blog entries, letters)
   Add class="letras" to <body>
   ========================================================== */

body.letras {
  --bg: #f5ede3;
  --surface: #fffbf5;
  --accent: #9b4f3a;          /* rose clay */
  --accent-deep: #6f3525;
  --accent-soft: #f3e1d7;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.85;
  background:
    radial-gradient(circle at 15% 0%, rgba(155, 79, 58, 0.06), transparent 45%),
    var(--bg);
}

body.letras .container {
  max-width: 720px;
  padding: 3.25rem 3.5rem;
  box-shadow: 0 1px 2px rgba(80, 45, 25, 0.04), 0 14px 40px rgba(80, 45, 25, 0.08);
}

@media (max-width: 700px) {
  body.letras .container {
    padding: 2rem 1.35rem;
  }
}

body.letras nav ul li a {
  font-family: var(--font-sans);
}

body.letras h1 {
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  margin-bottom: 0.5rem;
}

/* ornament under the title */
body.letras h1::after {
  content: "\2767";
  display: block;
  margin-top: 0.6rem;
  font-size: 1.1rem;
  font-style: normal;
  color: var(--accent);
  opacity: 0.6;
}

body.letras h2::after {
  display: none;
}

/* article subtitle (h1 followed by h2) */
body.letras h1 + h2 {
  margin: 0 0 0.25rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
}

body.letras h1 + h2 + p,
body.letras h1 + p {
  text-align: center;
}

body.letras h3 {
  font-size: 1.25rem;
  color: var(--accent-deep);
}

body.letras p.subtitle {
  margin-top: 0;
  text-align: center;
  font-style: italic;
  color: var(--muted);
  font-size: 0.98rem;
}

body.letras em {
  color: inherit;
}

body.letras blockquote {
  margin: 2.25rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 2px solid var(--accent);
  background: none;
  border-radius: 0;
  font-size: 1.25rem;
  line-height: 1.6;
}

body.letras .signature {
  margin-top: 2.5rem;
  text-align: right;
  font-style: italic;
  color: var(--accent-deep);
}

body.letras hr {
  height: auto;
  background: none;
  text-align: center;
  margin: 3rem 0;
}

body.letras hr::after {
  content: "\2022\00a0\00a0\2022\00a0\00a0\2022";
  color: var(--accent);
  opacity: 0.55;
  letter-spacing: 0.3em;
}

.author-note {
  margin: 1.75rem 0;
}

.highlight {
  font-weight: 700;
}

.hero-image {
  width: 100%;
  margin: 2rem 0;
  border-radius: 10px;
}

/* ---------- Poems ---------- */

.poem {
  margin: 2.5rem 0;
}

.poem h2 {
  margin: 0 0 1rem;
  font-size: 1.45rem;
  font-style: italic;
}

.poem p {
  line-height: 1.9;
}

.bilingual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.bilingual .poem-es,
.bilingual .poem-en {
  padding: 1.5rem 1.6rem;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.bilingual .poem-es {
  background: #fdf6ee;
}

.bilingual .poem-en {
  background: #f8f1ea;
}

.bilingual .poem-en h2 {
  color: var(--muted);
}

@media (min-width: 760px) {
  body.letras .container:has(.bilingual) {
    max-width: 900px;
  }

  .bilingual {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Blog previews (on Letras index) ---------- */

.blog-preview {
  margin: 1.5rem 0;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdf6ee;
}

.blog-preview h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.blog-preview h2 a {
  color: var(--accent-deep);
  text-decoration: none;
}

.blog-preview h2 a:hover {
  color: var(--accent);
}

.preview-subtitle {
  margin-bottom: 0.25rem;
  font-style: italic;
  color: var(--muted);
}

/* ---------- Accessibility ---------- */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- Milestone pages ---------- */

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.milestone-page .milestone-number,
.milestone-page .milestone-meta {
  text-align: center;
}

.milestone-page blockquote {
  text-align: center;
  border-left: 0;
  border-radius: 10px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: center;
  margin: 2rem 0;
}

.photo-gallery figure {
  margin: 0;
}

.photo-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(80, 45, 25, 0.12);
}

.photo-gallery.single {
  grid-template-columns: 1fr;
}

/* one portrait (3:4) + one landscape (4:3) photo at equal height */
@media (min-width: 640px) {
  .photo-gallery.mixed {
    grid-template-columns: 9fr 16fr;
  }
}

/* three landscape photos in a row */
@media (min-width: 640px) {
  .photo-gallery.trio {
    grid-template-columns: repeat(3, 1fr);
  }
}

.photo-gallery + .photo-gallery {
  margin-top: -1rem;
}

/* a single portrait photo, kept to a comfortable size */
.photo-gallery.single.narrow img {
  max-width: 560px;
  margin: 0 auto;
}
