/* ============================================================
   Clement Marot Website - stylesheet

   EB Garamond (headings) and Inter (body text) are served from
   fonts/ - no reference to Google. Each font falls back on what
   the computer has itself, in case a file ever goes missing.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-v20-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-v20-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-v20-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-v20-latin-500italic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-v20-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-v20-latin-700italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/eb-garamond-v33-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/eb-garamond-v33-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/eb-garamond-v33-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/eb-garamond-v33-latin-600italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

/* ============================================================
   Foundations
   ============================================================ */

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

/* ---------- Colour and spacing variables ---------- */
:root {
  --bg: #fbf9f5;
  --border: #cbbfa8;
  --accent: #5e3c1f;
  --accent-light: #b8916e;
  --text: #2b2520;
  --muted: #6a665c;
  --paper: #fffefb;
}

/* ============================================================
   Base typography
   ============================================================ */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4 {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--accent);
  margin-top: 1.2em;
  margin-bottom: .4em;
  font-weight: 600;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

p {
  margin: 0 0 1em 0;
}

a {
  color: #C8661F;
  text-decoration: none;
  transition: color .15s ease;
}
a:hover, a:focus {
  color: #c1743f;
  text-decoration: underline;
}

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

/* ============================================================
   Header and navigation
   ============================================================ */

.site-header {
  border-bottom: 3px double var(--border);
  background: linear-gradient(#fffefb, #f5f0e8);
  padding: .5rem 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.marot-thumb {
  width: 70px;
  border: 2px solid var(--border);
  border-radius: 4px;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, .15);
}

.title-block h1 {
  font-size: 1.9rem;
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--accent-light);
  font-size: .95rem;
  font-weight: 500;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .6rem;
  padding-bottom: .6rem;
  border-top: 1px solid var(--border);
}

.topnav a {
  background: #fdfaf5;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .4rem .8rem;
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 0 #fff inset;
}

.topnav a:hover,
.topnav a:focus {
  background: #f7f2ea;
  border-color: var(--accent-light);
}

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

/* ============================================================
   Main content area
   ============================================================ */

.content {
  max-width: 1024px;
  margin: 2rem auto;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.content h2 {
  color: var(--accent);
  margin-top: 1.25rem;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 3px double var(--border);
  text-align: center;
  padding: 1rem 0;
  font-size: .9rem;
  color: var(--accent-light);
  background: #f8f6f2;
}

/* ============================================================
   Images and captions
   ============================================================ */

/* Without this rule figure keeps the browser default indent of
   about 40px and the image no longer lines up with the text. */
figure {
  margin: 2em 0;
}

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  padding-top: .4rem;
}

.float-right {
  float: right;
  margin: 0 0 1em 1em;  /* top, right, bottom, left margins */
  width: 120px;         /* or whatever fits your layout */
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ============================================================
   Audio - a recording with a caption
   ============================================================ */

/* The player is the browser's own; it gets the full column width
   so that the time bar is long enough to be usable. */
figure.audio {
  margin: 1.75rem 0;
}

figure.audio audio {
  display: block;
  width: 100%;
}

figure.audio figcaption {
  text-align: left;
}

/* several recordings in a row: less space between them */
figure.audio + figure.audio { margin-top: 1rem; }

/* A series of recordings: caption above the player, so that it is
   not read together with the recording below it. In the page:
   <figure class="audio caption-first"> ... */
figure.audio.caption-first {
  display: flex;
  flex-direction: column-reverse;
}

figure.audio.caption-first figcaption {
  padding: 0 0 .4rem;
}

/* ============================================================
   Tables and lists
   ============================================================ */

table {
  border-collapse: collapse;
  margin: 1em 0;
}

td, th {
  padding: .4em .6em;
  border: 1px solid var(--border);
  vertical-align: top;
}

ul, ol {
  margin: 0 0 1em 1.4em;
}

/* ============================================================
   Gallery
   ============================================================ */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 1.7rem;
}

.gallery figure {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.gallery img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  transition: transform .2s ease;
}

.gallery img:hover {
  transform: scale(1.03);
}

.gallery figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: .4rem;
  line-height: 1.4;
}

/* ============================================================
   Critical apparatus - poem text beside critical remarks
   ============================================================ */

/* Layout container */
.critical-apparatus {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
  font-family: Georgia, serif;
}

/* Row pairing poem text with critical remarks */
.apparatus-row {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 50/50 split on desktop */
  gap: 2rem;
  align-items: flex-start; /* Keeps notes aligned to the top of the section */
  border-bottom: 1px dashed #ccc;
  padding-bottom: 1rem;
}

/* Column styling */
.poem-col {
  line-height: 1.6;
}

.notes-col {
  font-size: 0.9em;
  color: #444;
  line-height: 1.5;
}

/* Titles and headings */
.poem-col h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  margin: 0 0 0.25rem 0;
}

.poem-col .subtitle {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Responsive behavior for mobile screens (phones) */
@media (max-width: 768px) {
  .apparatus-row {
    grid-template-columns: 1fr; /* Collapse to 1 column */
    gap: 0.5rem;
  }
  
  .notes-col {
    background-color: #f9f9f9;
    border-left: 3px solid #800000;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
  }
}

/* ============================================================
   Leftovers from the FrontPage conversion
   ============================================================ */

/* Empty paragraphs were used as spacers */
p:empty {
  display: none;
}

/* <p> inside <li> should not add extra gaps */
li p {
  margin: 0.2em 0 0.4em 0;
}

hr {
  margin: 1.5em 0;
  border: 0;
  border-top: 1px solid #ccc;
}

/* ============================================================
   Mobile adjustments
   ============================================================ */

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .topnav {
    justify-content: center;
  }

  .content {
    padding: 1rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
}
