/* Shared styles for all Spanish verb tense pages */
:root {
  --bg: #0f0e17;
  --surface: #1a1927;
  --card: #211f33;
  --border: #2e2b47;
  --text: #fffffe;
  --muted: #a7a9be;
  --accent: #ff8906;
  --irreg: #e8594a;
  --irreg-bg: #2a1210;
  --irreg-border: #5c2020;
  --ar: #ff80b3;
  --er: #6b8dd9;
  --ir: #cfa715;
  --tip: #4ade80;
  --tip-bg: #052e16;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: calc(62px + 1.5rem) 1.5rem 4rem;
  max-width: 980px;
  margin: 0 auto;
}

/* Colour helpers */
.ar  { color: var(--ar);    font-weight: 700; }
.er  { color: var(--er);    font-weight: 700; }
.ir  { color: var(--ir);    font-weight: 700; }
.irr { color: var(--irreg); font-weight: 700; }

/* ── Site header (brand) ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: #FDDEE9;
  border-bottom: 1px solid rgba(224,85,120,.18);
  display: flex;
  flex-direction: column;
}
.site-header-inner {
  display: flex;
  align-items: center;
  height: 62px;
  padding: 0 1.5rem;
  gap: 1.2rem;
}
.site-logo img { height: 44px; width: auto; display: block; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-left: auto;
}
.site-nav .nav-link {
  font-size: .85rem;
  font-weight: 500;
  color: #1E2D4E;
  opacity: .75;
  text-decoration: none;
  transition: opacity .2s;
}
.site-nav .nav-link:hover { opacity: 1; }
.btn-preply {
  padding: .38rem .95rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  background: #E05578;
  color: #fff;
  border: 2px solid #E05578;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn-preply:hover { background: transparent; color: #E05578; }
.site-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: .4rem;
  margin-left: auto;
  cursor: pointer;
}
.site-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1E2D4E;
  border-radius: 2px;
}
.site-nav-mobile {
  display: none;
  flex-direction: column;
  background: #FDDEE9;
  border-top: 1px solid rgba(224,85,120,.18);
  padding: .8rem 1.5rem;
  gap: .4rem;
}
.site-nav-mobile.open { display: flex; }
.site-nav-mobile a {
  font-size: .9rem;
  font-weight: 500;
  color: #1E2D4E;
  text-decoration: none;
  padding: .25rem 0;
}
@media (max-width: 640px) {
  .site-nav { display: none; }
  .site-nav-toggle { display: flex; }
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: .92rem; color: var(--muted);
  margin-bottom: 2rem;
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: #3e3c55; font-size: 1rem; }
.breadcrumb .curr { color: var(--text); font-weight: 600; }

/* ── Page heading ── */
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700; line-height: 1.15; margin-bottom: .4rem;
}
.page-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 1rem; }
.title-accent {
  display: inline-block; width: 60px; height: 4px;
  background: var(--accent); border-radius: 2px; margin-bottom: 1.6rem;
}

/* ── Legend ── */
.legend { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.8rem; }
.legend-item {
  display: flex; align-items: center; gap: .4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: .3rem .85rem;
  font-size: .95rem; font-weight: 500;
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.dot-ar    { background: var(--ar); }
.dot-er    { background: var(--er); }
.dot-ir    { background: var(--ir); }
.dot-irreg { background: var(--irreg); }

/* ── Tense card ── */
.tense-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-bottom: .8rem;
  animation: fadeUp .4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tense-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .6rem; padding: 1rem 1.3rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.tense-header-left { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.tense-name { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; }
.tense-equiv { font-size: .97rem; color: var(--muted); font-style: italic; }
.tense-body { padding: 1.3rem; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 1.2rem; }
thead th {
  text-align: left; color: var(--muted); font-weight: 500;
  font-size: .9rem; text-transform: uppercase; letter-spacing: .08em;
  padding: 0 .6rem .75rem; border-bottom: 1px solid var(--border);
}
tbody td {
  padding: .65rem .6rem; border-bottom: 1px solid #1e1c30;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
td.pronoun { color: var(--muted); font-size: 1rem; width: 22%; }

/* ── Tip ── */
.tip-tag {
  background: var(--tip-bg); border-left: 3px solid var(--tip);
  color: var(--tip); border-radius: 0 6px 6px 0;
  padding: .65rem .9rem; font-size: 1rem; line-height: 1.5; margin-top: 1.1rem;
}
.tip-tag strong {
  font-size: .88rem; text-transform: uppercase;
  letter-spacing: .06em; opacity: .85;
}
.tip-tag strong:first-child {
  display: block; margin-bottom: .3rem;
}

/* ── Buttons ── */
.btn-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.1rem; }
.examples-btn {
  background: rgba(255,137,6,0.15); border: 1px solid rgba(255,137,6,0.38);
  color: var(--accent); border-radius: 8px; padding: .45rem 1rem;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: background .2s;
}
.examples-btn:hover { background: rgba(255,137,6,0.3); }
.irreg-link {
  font-size: .95rem; font-weight: 600; color: var(--irreg);
  background: var(--irreg-bg); border: 1px solid var(--irreg-border);
  border-radius: 6px; padding: .3rem .75rem; text-decoration: none;
  transition: background .2s; white-space: nowrap; margin-left: auto;
}
.irreg-link:hover { background: var(--irreg); color: #fff; }
.back-reg-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .95rem; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: .3rem .75rem; text-decoration: none;
  transition: color .2s; margin-bottom: 1.5rem;
}
.back-reg-link:hover { color: var(--text); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.72); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; max-width: 580px; width: 90%;
  max-height: 82vh; overflow-y: auto; position: relative;
}
.modal-close {
  position: absolute; top: .9rem; right: 1rem;
  background: transparent; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
  font-family: 'DM Sans', sans-serif;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; margin-bottom: 1.3rem;
}
.example-item {
  margin-bottom: 1rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.example-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.example-es { font-size: 1.15rem; margin-bottom: .3rem; }
.example-en { font-size: 1.02rem; color: var(--muted); font-style: italic; }

/* ── Irregular sections ── */
.irreg-section {
  background: var(--irreg-bg); border: 1px solid var(--irreg-border);
  border-radius: 14px; overflow: hidden; margin-bottom: 1.8rem;
  animation: fadeUp .4s ease both;
}
.irreg-section-header {
  display: flex; align-items: center; gap: .7rem; padding: .75rem 1.2rem;
  background: #351515; border-bottom: 1px solid var(--irreg-border);
}
.irreg-badge {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; background: var(--irreg); color: #fff;
  border-radius: 4px; padding: .18rem .5rem;
}
.irreg-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 700; color: #ff9a8b;
}
.irreg-body { padding: 1.1rem 1.3rem; }
.verb-group { margin-bottom: 2.8rem; }
.verb-group-label {
  font-size: 1.05rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: var(--irreg);
  margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem;
}
.verb-group-label::after { content: ''; flex: 1; height: 1px; background: var(--irreg-border); }
.irreg-table-wrap { overflow-x: auto; margin-bottom: .6rem; }
.irreg-table { width: 100%; border-collapse: collapse; font-size: 1.15rem; }
.irreg-table thead th {
  background: #2a1210; color: var(--muted); font-weight: 500;
  font-size: .88rem; text-transform: uppercase; letter-spacing: .08em;
  padding: .45rem .6rem .55rem; border-bottom: 1px solid var(--irreg-border);
  white-space: nowrap;
}
.irreg-table tbody td {
  padding: .55rem .6rem; border-bottom: 1px solid #3a1515;
  vertical-align: middle;
}
.irreg-table tbody tr:last-child td { border-bottom: none; }
.irreg-table td.pronoun { color: var(--muted); font-size: 1rem; width: 18%; }
.irreg-table th.verb-col { min-width: 110px; }
.irreg-note {
  font-size: 1rem; color: #c9a0a0; background: #1e0e0e;
  border-left: 3px solid var(--irreg); border-radius: 0 6px 6px 0;
  padding: .5rem .8rem; margin-top: .6rem; line-height: 1.5;
}

/* ── Gerundio specific ── */
.gerundio-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: .8rem; margin: .5rem 0 1rem;
}
.gbox {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .8rem 1rem; text-align: center;
}
.gbox .glabel { font-size: .88rem; color: var(--muted); margin-bottom: .3rem; }
.gbox .gform { font-size: 1.3rem; font-weight: 600; }

/* ── Site footer ── */
.site-footer {
  text-align: center; margin-top: 4rem; color: var(--muted);
  font-size: .92rem; border-top: 1px solid var(--border); padding-top: 1.6rem;
}
.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: .35rem;
}
.footer-back { color: var(--muted); text-decoration: none; margin-top: .6rem; display: inline-block; }
.footer-back:hover { color: var(--text); }

[id] { scroll-margin-top: 1.5rem; }

/* ── ZC subgroup header row ── */
.irreg-table .zc-subhead {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--irreg); font-weight: 700; background: var(--irreg-bg);
  padding: .28rem .6rem; border-bottom: 1px solid var(--irreg-border);
}

/* ── Boot-verb columns table ── */
.boot-img { max-width: 180px; width: 100%; display: block; margin: 0 auto; }
.boot-img-stack { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.boot-img-stack .boot-img { max-width: 78px; }
.casos-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); text-align: center; margin-top: .35rem;
}
.irreg-table.boot-table { table-layout: fixed; }
.irreg-table.boot-table thead th {
  text-align: center; padding: .7rem .4rem .6rem;
  white-space: normal; vertical-align: bottom; border-bottom: none;
}
.irreg-table.boot-table tbody td {
  vertical-align: top; padding: .8rem .55rem; border-bottom: none;
}
.boot-verb { font-size: 1.05rem; line-height: 1.55; }
.boot-cat {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-top: .65rem; padding-bottom: .2rem;
  border-bottom: 1px solid var(--irreg-border);
}
.boot-cat:first-child { margin-top: 0; }

@media (max-width: 600px) {
  table, .irreg-table { font-size: 1rem; }
  tbody td { padding: .5rem .4rem; }
  .gerundio-row { grid-template-columns: 1fr; }
  .boot-img { max-width: 72px; }
  .boot-img-stack .boot-img { max-width: 56px; }
  .boot-verb { font-size: .9rem; }
}
