﻿/* cantatas.css — adds layout for text + translation */

main {
  max-width: 1100px;              /* wider for parallel text */
  padding: 1.5rem;
}

.lyrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
  align-items: start;
}

.lyrics-grid .col {
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.lyrics-grid .lang {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.poem { margin: 0.5rem 0; }
.stanza { margin: 0.5rem 0 1rem; }
.l { margin: 0; line-height: 1.55; }

/* footnotes or comment sections */
.footnotes {
  border-top: 1px solid #e6e6e6;
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #555;
}

/* responsive: single column on narrow screens */
@media (max-width: 900px) {
  .lyrics-grid {
    grid-template-columns: 1fr;
  }
  .lyrics-grid .col {
    background: #fff;
  }
}

/* ---------------------------------------------------------- */
/* Universal responsive grid for images, links, and text      */
/* ---------------------------------------------------------- */

.flex-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--cell-min, 220px), 1fr));
  gap: var(--cell-gap, 1.2rem);
  max-width: var(--grid-max, 900px);
  margin: 2rem auto;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

.flex-table-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: var(--cell-align, left);
  background: var(--cell-bg, #fff);
  padding: var(--cell-padding, 0.8rem);
  border-radius: var(--cell-radius, 8px);
  box-shadow: var(--cell-shadow, 0 1px 3px rgba(0,0,0,0.08));
  border: var(--cell-border, 1px solid rgba(0,0,0,0.06));
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.flex-table-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* links inside grid items */
.flex-table-item a {
  color: var(--link-color, #004080);
  text-decoration: none;
  font-weight: 600;
}
.flex-table-item a:hover {
  text-decoration: underline;
}

/* images */
.flex-table-item img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  transition: transform 0.2s ease;
}
.flex-table-item img:hover {
  transform: scale(1.05);
}

/* captions or secondary text */
.flex-table-item figcaption,
.flex-table-item small {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.3rem;
}

/* multi-column flowing text (newspaper style) *//* multi-column flowing text (newspaper style) */
.flex-columns {
  columns: var(--columns, 2) 300px;
  column-gap: 1.5rem;
  max-width: var(--grid-max, 900px);
  margin: 2rem auto;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  position: relative;
}

/* subtle vertical divider between columns */
.flex-columns::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(0, 0, 0, 0.08);
  transform: translateX(-50%);
  pointer-events: none;
}

/* responsive behavior */
@media (max-width: 900px) {
  .flex-columns {
    --columns: 2;
    column-gap: 1.25rem;
    max-width: 95%;
  }
}

@media (max-width: 600px) {
  .flex-columns {
    --columns: 1;
    column-gap: 1rem;
  }
  .flex-columns::before {
    display: none; /* hide divider on single-column view */
  }
}


/* ---------------------------------------------------------- */
/* Inline figures inside body text (single image + caption)   */
/* ---------------------------------------------------------- */

.inline-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem auto;
  max-width: 100%;
  text-align: center;
}

.inline-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.inline-figure img:hover {
  transform: scale(1.03);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.inline-figure figcaption {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
  line-height: 1.4;
  max-width: 90%;
}

/* floating variants for inline figures */
.inline-figure.left {
  float: left;
  margin: 0.5rem 1.25rem 1rem 0;
  max-width: 45%;
  text-align: left;
}

.inline-figure.right {
  float: right;
  margin: 0.5rem 0 1rem 1.25rem;
  max-width: 45%;
  text-align: right;
}

.inline-figure.left img,
.inline-figure.right img {
  border-radius: 4px;
}

@media (max-width: 600px) {
  .inline-figure {
    margin: 1rem auto;
  }
  .inline-figure figcaption {
    font-size: 0.85rem;
  }
  .inline-figure.left,
  .inline-figure.right {
    float: none;
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1rem auto;
    max-width: 100%;
  }
}
