/* =========================================================
   gregorian.css — Illuminated Manuscript Redesign (rev 4)
   Gregorian Books Mirror — gregorianbooks.com
   Palette: parchment / rubric red / near-black ink
   Typography: EB Garamond (self-hosted, OFL)
   ========================================================= */

/* ===== @font-face: EB Garamond (self-hosted) ===== */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/EBGaramond-Regular-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/EBGaramond-Regular.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
                 U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                 U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/EBGaramond-Italic-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/EBGaramond-Italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
                 U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                 U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== Design Tokens ===== */
:root {
  --parchment:     #f7f2e7;
  --parchment-deep:#efe7d5;
  --ink:           #2b2620;
  --rubric:        #8f2b1a;
  --rubric-hover:  #6d1f12;
  --rule:          #c9bda0;
  --rule-light:    #ddd3bc;
  --muted:         #7a6e60;
  --font-main:     'EB Garamond', Georgia, 'Times New Roman', serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 19px; }
body {
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--parchment);
  margin: 0;
  padding: 0;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-variant: small-caps;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.25;
  margin-top: 1.4em;
  margin-bottom: 0.4em;
}
p { max-width: 72ch; margin: 0.6em 0; }
i, em { font-style: italic; }
b, strong { font-weight: 600; }
sup {
  font-size: 70%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  top: -0.4em;
}

/* ===== Links ===== */
a { color: var(--rubric); text-decoration: none; }
a:hover { color: var(--rubric-hover); text-decoration: underline; }
a img { border: 0 none; text-decoration: none; }

/* ===== Site Header ===== */
.site-header {
  text-align: center;
  padding: 1.8rem 1rem 0;
  background: var(--parchment);
}
.site-header-inner {
  max-width: 900px;
  margin: 0 auto;
}
.site-title {
  display: block;
  font-family: var(--font-main);
  font-variant: small-caps;
  font-weight: 600;
  font-size: 2.6rem;
  color: var(--ink);
  letter-spacing: 0.07em;
  margin: 0 0 0.5rem;
  line-height: 1.1;
}
.site-dbl-rule {
  border: none;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  height: 5px;
  background: transparent;
  margin: 0 auto 0;
}

/* ===== Site Navigation ===== */
.site-nav {
  text-align: center;
  padding: 0.55rem 1rem;
  background: var(--parchment);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 200;
  letter-spacing: 0.02em;
}
.site-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.site-nav a {
  font-family: var(--font-main);
  font-variant: small-caps;
  font-size: 0.88rem;
  color: var(--rubric);
  margin: 0 0.45em;
  text-decoration: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--rubric-hover); text-decoration: underline; }
.site-nav a.active {
  color: var(--rubric-hover);
  font-weight: 600;
  border-bottom: 1px solid var(--rubric-hover);
}
.site-nav .nav-sep {
  color: var(--rule);
  margin: 0 0.1em;
}

/* ===== Site Main ===== */
.site-main {
  padding: 0;
}

/* ===== Page Columns ===== */
.page-col {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}
.page-col--wide {
  max-width: 1440px;
}

/* ===== Site Footer ===== */
.site-footer {
  text-align: center;
  padding: 1.25rem 1rem 1.5rem;
  border-top: 3px double var(--rule);
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 2.5rem;
  font-family: var(--font-main);
}
.site-footer a { color: var(--rubric); }
.site-footer a:hover { color: var(--rubric-hover); }

/* ===== Drop Caps ===== */
.lettrine1::first-letter,
.page-col > div > p:first-of-type::first-letter {
  float: left;
  font-size: 3.2em;
  line-height: 0.75;
  color: var(--rubric);
  margin-right: 0.08em;
  margin-top: 0.05em;
  font-weight: 400;
  font-variant: normal;
}

/* ===== Fleuron / Section Dividers ===== */
.fleuron {
  text-align: center;
  color: var(--rubric);
  font-size: 1.25rem;
  margin: 1.5rem 0;
  letter-spacing: 0.6em;
  padding-left: 0.6em;
}
hr.section-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 1.5rem 0;
}
hr.dbl-section-rule {
  border: none;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  height: 4px;
  background: transparent;
  margin: 1.5rem 0;
}

/* ===== Filter Bar ===== */
.filter-bar {
  background: var(--parchment-deep);
  border: 1px solid var(--rule);
  padding: 0.65rem 1rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.84rem;
  font-family: var(--font-main);
  color: var(--ink);
}
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="number"] {
  font-family: var(--font-main);
  font-size: 0.88rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--rule);
  background: var(--parchment);
  color: var(--ink);
  border-radius: 0;
  margin: 2px;
}
.filter-bar label { color: var(--ink); margin-right: 0.3em; }
#filter-count,
#chant-count { font-size: 0.82rem; color: var(--muted); margin-left: 0.75rem; }

/* ===== Table Scroll Wrapper ===== */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== HOME PAGE ===== */
/* Chant thumbnail images */
img.top_page1 {
  border-left:   1px solid var(--rule-light);
  border-bottom: 1px solid var(--rule);
}
img.top_page1:hover { border-color: var(--rubric); }

/* Home page intro prose */
.page-col .greg1 { float: right; margin-left: 1rem; }
.page-col .greg1 img { border: 2px double var(--rule); }

/* ===== MAIN TABLES (.table1) ===== */
.table1 {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.83rem;
  font-family: var(--font-main);
  line-height: 1.45;
}

/* Column headers */
.table1 th {
  font-family: var(--font-main);
  font-variant: small-caps;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--rubric);
  letter-spacing: 0.04em;
  border: none;
  border-bottom: 2px solid var(--rule);
  border-top: 1px solid var(--rule);
  padding: 0.45rem 0.4rem;
  vertical-align: bottom;
  background: var(--parchment);
}

/* Table cells */
.table1 td {
  border: none;
  border-bottom: 1px solid var(--rule-light);
  text-align: left;
  vertical-align: top;
  padding: 0.3rem 0.4rem;
  font-size: 0.83rem;
  font-family: var(--font-main);
}

/* Alternate row tint (overridden by specific category/mode classes) */
.table1 tbody tr:nth-child(even) td {
  background: var(--parchment-deep);
}

/* --- Header / feast rows inside chant tables --- */
.table1 .header {
  background: transparent !important;
}
.table1 .header td,
.table1 .header th {
  background: var(--parchment) !important;
  font-family: var(--font-main);
  font-variant: small-caps;
  color: var(--rubric);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0.4rem;
  letter-spacing: 0.06em;
}
.table1 .header0 td {
  font-size: 0.8rem;
  text-align: center;
}

/* --- Width overrides (preserved from original) --- */
.table1 .th_proper    { min-width:160px; width:180px; max-width:180px; }
.table1 .th_mode_tone { font-size: 0.65rem; }
.table1 .th_book      { width:64px; max-width:64px; }
.table1 .th_comments  { width:900px; max-width:900px; }
.table1 td.y, .table1 td.year,
.table1 td.p, .table1 td.pages { text-align: right; }
.table1 td.d, .table1 td.desc  { width: 480px; }

/* --- Category/type colors for books (toned for parchment) --- */
.table1 .g,    span.g,
.table1 .greg, span.greg  { background-color: #e6e3f0; }  /* gregorian chant books - soft periwinkle */

.table1 .b,    span.b,
.table1 .te,   span.te,
.table1 .book, span.book,
.table1 .text, span.text  { background-color: var(--parchment-deep); }  /* text / liturgical */

.table1 .h,    span.h,
.table1 .hist, span.hist  { background-color: #f2eae8; }  /* history - soft rose */

.table1 .v,       span.v,
.table1 .vatican, span.vatican { background-color: #f5edda; }  /* Vatican docs - warm buff */

.table1 .v2, span.v2,
.table1 .vatican2, span.vatican2,
.table1 .vatican_ii, span.vatican_ii,
.table1 .c,      span.c,
.table1 .council, span.council { background-color: #e8d9be; }  /* Council - deeper buff */

.table1 tr.pope td.y,
.table1 tr.pope td.year,
.table1 tr.pope td.t,
.table1 tr.pope td.title,
span.pope { background-color: #f5e840 !important; }  /* Vatican flag yellow */

/* --- Grey / uncertain --- */
.gr, .table1 .gr, .table1 .grey { color: var(--muted); }
.gr a, .table1 .gr a, .table1 .grey a { color: var(--rubric); opacity: 0.7; }

/* --- Separator bars --- */
.bar, td.bar {
  font-size: 1px;
  background: var(--rule);
  height: 3px;
  max-height: 3px;
}
.bar2, td.bar2 {
  font-size: 1px;
  background: var(--rule-light);
  height: 2px;
  max-height: 2px;
}
.bar0, td.bar0 {
  font-size: 1px;
  background: transparent;
  height: 3px;
  max-height: 3px;
}
.barv, td.barv   { font-size:1px; background:var(--rule); width:3px; max-width:3px; }
.bar1v, td.bar1v { font-size:1px; background:var(--rule); width:2px; max-width:2px; }
.bar2v, td.bar2v { font-size:1px; background:var(--rule-light); width:2px; max-width:2px; }

/* --- Day / service rows --- */
.table1 td.day,   span.day,
.table1 .service, span.service { background-color: #f5edda !important; }  /* warm buff */
.table1 .service, span.service { font-weight: 600; }
.table1 .na,      span.na      { background-color: var(--parchment-deep); }
.rubric                         { font-style: italic; color: var(--rubric); }
.table1 .skip, span.skip       { color: var(--muted); }

/* --- Kyriale section colors (preserved — content-meaningful) --- */
.sep1   { background-color: var(--ink); }
.kmiss1 { background-color: #666; }
.kmiss2 { background-color: var(--parchment-deep); }

.k1  { background-color: #FF5555; }
.k2  { background-color: var(--parchment-deep); }
.k3  { background-color: var(--parchment-deep); }
.k4  { background-color: #FF9999; }
.k5  { background-color: var(--parchment-deep); }
.k6  { background-color: var(--parchment-deep); }
.k7  { background-color: var(--parchment-deep); }
.k8  { background-color: #FFFF80; }
.k9  { background-color: #9999FF; }
.k10 { background-color: var(--parchment-deep); }
.k11 { background-color: #55CC33; }
.k12 { background-color: var(--parchment-deep); }
.k13 { background-color: var(--parchment-deep); }
.k14 { background-color: var(--parchment-deep); }
.k15 { background-color: #CCCCFF; }
.k16 { background-color: #AAEE88; }
.k17 { background-color: #CC33AA; }
.k18 { background-color: #EEBBDD; }

.kyriale1 td.k1,  .kyriale1 td.k2,  .kyriale1 td.k3,  .kyriale1 td.k4,  .kyriale1 td.k5,
.kyriale1 td.k6,  .kyriale1 td.k7,  .kyriale1 td.k8,  .kyriale1 td.k9,  .kyriale1 td.k10,
.kyriale1 td.k11, .kyriale1 td.k12, .kyriale1 td.k13, .kyriale1 td.k14, .kyriale1 td.k15,
.kyriale1 td.k16, .kyriale1 td.k17, .kyriale1 td.k18,
.kyriale1 td.k_ { text-align: center; }

.kyriale1 th.kth { vertical-align: top; }

/* --- Gregorian modes (preserved — content-meaningful) --- */
.m1, .m2, .m3, .m4, .m5, .m6, .m7, .m8, .m8G, .m8g, .m_none {
  text-align: center !important;
  padding-left: 1px;
  padding-right: 1px;
}
.m1 { background-color: #B49078; }  /* serious    - brown   */
.m2 { background-color: #BBBBBB; }  /* sad        - grey    */
.m3 { background-color: #99CC99; }  /* mystic     - green   */
.m4 { background-color: #9FFF00; }  /* harmonious - lime    */
.m5 { background-color: #FFAACC; }  /* glad       - pink    */
.m6 { background-color: #FFA500; }  /* devout     - orange  */
.m7 { background-color: #FFFF99; }  /* angelic    - yellow  */
.m8G, .m8g,
.m8 { background-color: #80A0FF; }  /* perfect    - blue    */

/* Mode border variants */
.m1b { border-color:#B49078; } .m2b { border-color:#BBBBBB; }
.m3b { border-color:#99CC99; } .m4b { border-color:#9FFF00; }
.m5b { border-color:#FFAACC; } .m6b { border-color:#FFA500; }
.m7b { border-color:#FFFF99; }
.m8Gb, .m8gb, .m8b { border-color:#80A0FF; }
.m_noneb { border-color: var(--rule); }
.m1b,.m2b,.m3b,.m4b,.m5b,.m6b,.m7b,.m8b,.m8Gb,.m8gb,.m_noneb {
  border-width:1px; border-style:solid;
  padding-left:3px; padding-right:3px;
}
.m_none_border {
  border: 1px solid var(--rule);
  padding-left: 3px; padding-right: 3px;
  font-size: 0.8em;
}

/* --- French / language marker --- */
.french {
  font-family: var(--font-main) !important;
  font-size: 1.15em !important;
  font-style: italic;
}
.english {
  font-family: var(--font-main) !important;
  font-size: 1em !important;
}

/* --- Minimalist table (used in legend areas) --- */
table.minimalist { border: 0; padding: 1px; }
table.minimalist td,
table.minimalist th {
  border: 0;
  font-size: 0.72rem;
  font-family: var(--font-main);
  padding: 1px;
  margin: 1px;
  vertical-align: top;
}

/* --- Float layouts for chant rows --- */
.greg0      { float: left; }
.greg0 a    { color: var(--ink); }
.greg00     { float: left; font-weight: 600; }
.greg1      { float: right; }
.greg1 img  {
  border-left:   1px dotted var(--rule-light);
  border-bottom: 1px solid var(--rule);
}
.greg1 img:hover { border-color: var(--rubric); }

/* --- JIB links (right-float reference links) --- */
.jib {
  float: right;
  background: var(--parchment-deep);
  padding-left: 3px; padding-right: 3px;
  margin-left: 2px;
  border-right: 1px solid var(--rule);
  border-left:  1px solid var(--parchment);
}
.bij { display: none; }
.jib a { color: var(--ink); }

/* --- Pitch annotation --- */
.pitch0 { display: none; }
.pitch1 {
  float: right;
  border: 1px solid var(--rule);
  padding-left: 3px; padding-right: 3px;
  font-weight: 600;
  margin-left: 10px;
  color: var(--muted);
  background: var(--parchment);
}
.pitch2 {
  border: 1px solid var(--rule);
  padding-left: 3px; padding-right: 3px;
  font-weight: 600;
  color: var(--muted);
}
.alter1 { color: var(--muted); font-size: 0.9em; }

/* --- YouTube / audio --- */
.yt1 { float: right; margin-left: 10px; }

/* --- Service label --- */
.ser { font-weight: 600; }

/* --- Proper title / mass links --- */
td.pr a, td.mass a { color: var(--ink); }

/* --- Border utilities --- */
td.btb  { border-top-color:    var(--parchment); }
td.bbb  { border-bottom-color: var(--parchment); }
td.btb2 { border-top-color:    var(--rule-light); }
td.bbb2 { border-bottom-color: var(--rule-light); }
td.btb3 { border-top:    dotted 1px var(--rule-light); }
td.bbb3 { border-bottom: dotted 1px var(--rule-light); }
td.btb4 { border-top-color:    var(--parchment); }
td.bbb4 { border-bottom-color: var(--parchment); }

/* --- "From" (cross-reference) rows --- */
td.from               { background-color: var(--parchment-deep); }
td.from img           { opacity: 0.5; filter: alpha(opacity=50); }
td.from img:hover     { opacity: 1;   filter: alpha(opacity=100); }
td.from .pitch1       { background-color: var(--parchment-deep); }
td.from0, span.from0, div.from0, a.from0 { background-color: #e8e0d0; }
td.no_from0, span.no_from0, div.no_from0, a.no_from0 { background-color: var(--parchment); }

/* --- Psalm references --- */
.ps0, .bk0, a.ps0 { color: #2a6b2a; }
.ps1               { font-style: italic; color: var(--muted); }

/* --- HR variants --- */
hr.hr_thin,
.ps1 hr {
  width: 50%; text-align: left; margin-left: 0;
  height: 1px; border: 0;
  color: var(--rule); background-color: var(--rule);
  margin-top: 3px; margin-bottom: 3px;
}
hr.hr_of {
  height: 1px; border: 0;
  color: var(--rule); background-color: var(--rule);
  margin-bottom: 3px;
}

/* --- Chant / proper anchor link colors --- */
a.proper, a.saints, a.hymn, a.kyriale { color: var(--muted); }
a.proper:hover, a.saints:hover, a.hymn:hover, a.kyriale:hover { text-decoration: underline; }
a.proper:visited, a.saints:visited, a.hymn:visited, a.kyriale:visited { color: var(--muted); }

/* --- Absent from book --- */
.absent { color: var(--muted); white-space: nowrap; }

/* --- Liturgical season annotations --- */
.advent {
  border: solid 1px #8888bb;
  padding: 0 2px;
  background-color: #e8e8f4;
  color: #333366;
}
.tp, .pt, .pasch, .pasc {
  border: solid 1px var(--rule);
  padding: 0 2px;
}
.sept, .lent, .passion {
  color: var(--rubric);
  border: solid 1px var(--rubric);
  padding: 0 2px;
}

/* --- Mode legend padding --- */
.pn { padding-left: 5px !important; padding-right: 5px !important; }
.nfinal, .ntenor { text-align: center !important; }

/* --- Warning text --- */
.warn { color: var(--rubric); }

/* --- Latin / Translation blocks --- */
.latin {
  color: var(--ink);
  background-color: var(--parchment-deep);
  font-style: italic;
  border-bottom: dotted 1px var(--rule-light);
  border-right:  dotted 1px var(--rule-light);
  padding-right: 3px;
}
.translation {
  color: #1a335a;
  background-color: var(--parchment-deep);
  border-bottom: dotted 1px var(--rule-light);
  border-right:  dotted 1px var(--rule-light);
  padding-right: 3px;
}

/* --- Summorym Pontificum special style --- */
.summorum { border: 2px solid var(--ink); }
.summorum td {
  background-attachment: scroll !important;
  background-repeat: repeat !important;
  background-image: url('img/gregorian/bg_vatican.jpg') !important;
}

/* --- Small utility classes --- */
.small1, .small10 { font-size: 10px; }
.small2, .small12 { font-size: 12px; }
.en { font-size: 9px; color: var(--muted); }
.strike    { text-decoration: line-through; }
.grey      { color: var(--muted); }
.nope, .invisible { visibility: hidden; }
.avail     { color: var(--rubric); }
.ebay, .uniq { color: var(--rubric); }
.no_bid, .not_sold { color: var(--rubric-hover); }
.no_bid, .not_sold, .sold, .sold_out { text-decoration: line-through; }
a .no_bid:hover, a .not_sold:hover, a .sold:hover, a .sold_out:hover { text-decoration: underline; }
#books_table .sold, #books_table .no_bid, #books_table .not_sold { font-size: 10px; }
.img1 { /* preserved */ }
.small_quote { color: var(--muted) !important; }
a.uln { text-decoration: underline; }
img.gb { border: 1px solid var(--rule); }

/* --- table.zero and table.un --- */
table.zero    { border: none; }
table.zero th,
table.zero td { border: none; }
td.zero       { border: none; }
table.un      { border: 2px solid var(--rule); border-collapse: collapse; }
table.un th   { border: 2px solid var(--rule); }
table.un td   { border: 1px solid var(--rule); }

/* --- Title floating blocks (used on books page) --- */
.title1, .title2 {
  float: right;
  font-family: var(--font-main);
  font-weight: 600;
  color: var(--rubric);
  background-color: var(--parchment-deep);
  border-bottom: 1px solid var(--rule);
  border-right:  1px solid var(--rule-light);
  padding: 0 4px;
}
.title1 { font-size: 1.6em !important; }
.title2 { font-size: 1.2em !important; }
.titleh { color: var(--rubric) !important; background-color: var(--parchment-deep); }

/* --- Table.table1 subtype table1c, table1fs --- */
.table1c td    { text-align: center !important; }
.table1fs td,
.table1fs th   { font-size: 16px !important; }

/* --- Secondary tables on books page --- */
#japanese_table td,
#paleographie_table td,
#yankton_table td { font-size: 0.7em !important; }
#japanese_table td.t,     #japanese_table td.title,
#paleographie_table td.t, #paleographie_table td.title,
#yankton_table td.t,      #yankton_table td.title { width: 300px; }
#yankton_table td.d,      #yankton_table td.desc  { width: 700px; }

/* --- Doubleleft cell --- */
td.doubleleft { border-left: 3px double var(--rule); }

/* --- Click-slice / misc --- */
.click_slice {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-main);
}
.refrain { border: 1px dotted #99990; background-color: #FFFFAA; }
.mid     { position: relative; top: 0; right: -10px; }

/* --- The "full page" link --- */
.the_full_page {
  font-size: 14px;
  border: 1px solid var(--rule);
  border-right-width: 2px;
  border-bottom-width: 2px;
  padding: 4px 10px 3px;
  background-color: var(--parchment-deep);
}
.the_full_page:hover { background-color: #e0d8c8; border-color: var(--rubric); text-decoration: none; }

/* --- Old top_menu (hidden in new design) --- */
.top_menu  { display: none; }
.top_menu2 { display: none; }
#top_mp3   { display: none; }

/* --- Psalm2 blocks --- */
.psalm2 {
  font-size: 19px;
  background-color: var(--parchment-deep);
  font-family: var(--font-main);
  border: 1px solid var(--rule);
  border-right-width: 2px;
  border-bottom-width: 2px;
  padding: 0 4px;
  width: 99%;
  max-width: 99%;
}
.psalm2 td { }
.psalm2 b  { color: var(--rubric); }
.psalm2 i  { color: #1a335a; }
.psalm2 .flex {
  font-size: 18px;
  color: var(--ink);
  font-family: Symbol, var(--font-main);
}
.fancy_star { }
.psalm2_title_latin { text-align: center; font-weight: 600; }
.psalm2_title_tr    { text-align: center; font-family: var(--font-main); font-size: 19px; }
.psalm2 .m1  { }
.psalm2_latin {
  padding: 0; text-align: left; width: 55%; font-size: 19px;
}
.psalm2_latin u,
.psalm2_latin i > u,
.psalm2_latin u > i { text-decoration-thickness: 1px; }
.psalm2_latin b > u { text-decoration-thickness: 2px; }
.psalm2_tr {
  padding: 0; text-align: left; width: 45%;
  font-family: var(--font-main); font-size: 19px;
}
.psalm2 .n_latin { color: var(--muted); font-size: 18px; text-align: right; width: 1%; max-width: 1%; }
.psalm2 .n_tr    { color: var(--muted); font-family: var(--font-main); font-size: 18px; text-align: right; width: 1%; max-width: 1%; }
.psalm2 .seps, .psalm2 .split { font-size: 8px; }
.psalm2 .seps-, .psalm2 .split- { font-size: 0.5em; color: var(--muted); }
#mode_legend_reduced td { padding-top: 0 !important; padding-bottom: 0 !important; }

/* --- Pre-1955 annotation --- */
.pre1955 {
  border: 1px dotted var(--rubric);
  padding: 0 2px;
  background-color: #FFFF00;
}

/* --- Font family overrides (content-author choices, preserved) --- */
.ssp, .poussielgue, .desclee {
  font-family: var(--font-main) !important;
  font-size: 1em !important;
  font-weight: 600 !important;
}
.ssp { color: #000099; }
.constantia { font-family: Constantia, var(--font-main) !important; }
.georgia    { font-family: Georgia, var(--font-main) !important; }
.candara    { font-family: Candara, var(--font-main) !important; }
.corbel     { font-family: Corbel, var(--font-main) !important; }
.constantia, .candara, .corbel { font-size: 1.1em !important; font-weight: 600 !important; }
.georgia    { font-size: 1em !important; font-weight: 600 !important; }
dl { margin-top: 0; margin-bottom: 0; }
dd { margin-left: 10px; }

/* ===== Column hairline rules — main index tables ===== */
/* Vertical separator between every column pair.
   Selects td/th preceded by a sibling — automatically excludes
   first-child cells and full-width single-td spanning rows
   (td.bar, td.bar2, td.bar0, td.day, td.service, synthetic
   coll-sect-hdr TDs) because they have no preceding sibling. */
#main_table td + td,
#main_table th + th {
  border-left: 1px solid var(--rule);
}
/* Belt-and-suspenders: any spanning cell must not show an interior
   vertical (covers edge cases where a spanner is not first-child). */
#main_table td[colspan] {
  border-left: none;
}

/* ===== BOOKS PAGE — CARD GRID ===== */
/* Transform the books table into a responsive card grid */

/* Container: table becomes a block */
#books_table {
  display: block;
  width: 100%;
}

/* tbody becomes a grid of cards */
#books_table tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
  padding: 0.75rem 0;
  /* Override table-row-group display */
  width: 100%;
}

/* Column-header section rows: full width, styled as section heading */
#books_table tr.section-row.header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--parchment);
  margin-top: 0.25rem;
}
#books_table tr.section-row.header th {
  font-variant: small-caps;
  color: var(--rubric);
  border: none;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  border-bottom: none;
  border-top: none;
}

/* Bar/separator section rows: full width, thin rule */
#books_table tr.section-row:not(.header) {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  background: var(--rule-light);
  border: none;
  margin: 0.5rem 0;
}
#books_table tr.section-row:not(.header) td {
  display: none;
}

/* Each book-row becomes a card */
#books_table tr.book-row {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  background: var(--parchment-deep);
  position: relative;
  /* Override category colors via border-left accent */
}

/* Category accent: left border color */
#books_table tr.book-row.g,
#books_table tr.book-row.greg { border-left: 4px solid #9090cc; background: #ede9f4; }
#books_table tr.book-row.h,
#books_table tr.book-row.hist { border-left: 4px solid #c09898; background: #f5eded; }
#books_table tr.book-row.v,
#books_table tr.book-row.vatican { border-left: 4px solid #c8a860; background: #f8f0e0; }
#books_table tr.book-row.v2,
#books_table tr.book-row.v,
#books_table tr.book-row.council,
#books_table tr.book-row.c { border-left: 4px solid #aa8840; background: #f0e4c8; }

/* Book-card cells: all display block */
#books_table tr.book-row td {
  display: block;
  border: none;
  border-bottom: none;
  padding: 0.1rem 0;
  font-size: 0.84rem;
  background: transparent !important; /* remove individual cell backgrounds */
}

/* Title cell — prominent, small-caps */
#books_table tr.book-row td.t,
#books_table tr.book-row td.title {
  order: 1;
  font-variant: small-caps;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--rule-light);
  margin-bottom: 0.3rem;
}

/* Year cell — secondary */
#books_table tr.book-row td.y,
#books_table tr.book-row td.year {
  order: 2;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: left;
}

/* Pages cell — tertiary */
#books_table tr.book-row td.p,
#books_table tr.book-row td.pages {
  order: 3;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: left;
}

/* Description cell — main body */
#books_table tr.book-row td.d,
#books_table tr.book-row td.desc {
  order: 4;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.5;
  flex: 1;
  margin-top: 0.35rem;
  width: auto; /* override the 480px width for cards */
  max-width: none;
}

/* Reference / shopping link cells */
#books_table tr.book-row td:nth-child(5) {
  order: 5;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--rule-light);
}
#books_table tr.book-row td:nth-child(6) {
  order: 6;
  font-size: 0.78rem;
}

/* Pope-special yellow override for cards */
#books_table tr.book-row.pope { background: #f5f0c8; border-left: 4px solid #c8a800; }

/* ===== 404 PAGE ===== */
.pg-404 {
  max-width: 640px;
  margin: 4rem auto;
  padding: 2.5rem 2rem;
  text-align: center;
  border: 3px double var(--rule);
}
.pg-404 .pg-404-ornament {
  font-size: 2rem;
  color: var(--rubric);
  margin-bottom: 1rem;
  display: block;
}
.pg-404 h1 {
  font-variant: small-caps;
  color: var(--rubric);
  font-size: 1.8rem;
  margin: 0 0 0.75rem;
}
.pg-404 p { max-width: none; margin: 0.5rem auto; }
.pg-404 a { color: var(--rubric); }

/* ===== RESPONSIVE ===== */

/* Mobile: single-column card grid */
@media (max-width: 660px) {
  #books_table tbody {
    grid-template-columns: 1fr;
  }
}

/* Narrow: two columns at most */
@media (max-width: 880px) {
  #books_table tbody {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Nav wraps on mobile */
@media (max-width: 700px) {
  .site-nav { font-size: 0.82rem; }
  .site-nav-inner { white-space: normal; }
  .site-title { font-size: 1.9rem; }
}

/* Chant tables: horizontal scroll on small screens */
@media (max-width: 900px) {
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table1 .th_comments { width: auto; max-width: none; }
}

@media (max-width: 480px) {
  html { font-size: 16px; }
  .page-col { padding-left: 0.75rem; padding-right: 0.75rem; }
  .site-header { padding: 1.2rem 0.75rem 0; }
}

/* ===== Jump Bar ===== */
.jump-bar {
  position: sticky;
  top: 2.3rem;
  z-index: 150;
  background: var(--parchment-deep);
  border: 1px solid var(--rule);
  padding: 0.35rem 0.75rem;
  margin: 0 0 0.4rem;
}
.jump-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
}
.jump-bar-chip {
  display: inline-block;
  font-family: var(--font-main);
  font-variant: small-caps;
  font-size: 0.76rem;
  color: var(--rubric);
  background: var(--parchment);
  border: 1px solid var(--rule);
  padding: 0.12rem 0.4rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.4;
}
.jump-bar-chip:hover {
  color: var(--rubric-hover);
  background: var(--parchment-deep);
  text-decoration: none;
}
.jump-bar-ctrl {
  font-family: var(--font-main);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--parchment);
  border: 1px solid var(--rule-light);
  padding: 0.12rem 0.4rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.jump-bar-ctrl:hover { color: var(--rubric); border-color: var(--rule); }
.jump-bar-divider {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--rule);
  margin: 0 0.2rem;
  vertical-align: middle;
}

/* ===== Collapsible section headers ===== */
/* Synthetic season group headers (propers) */
tr.coll-sect-hdr { cursor: pointer; user-select: none; }
tr.coll-sect-hdr td {
  background: var(--parchment) !important;
  color: var(--rubric);
  font-family: var(--font-main);
  font-variant: small-caps;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.4rem;
  letter-spacing: 0.06em;
}
/* Existing day/service rows converted to section headers */
tr.coll-sect-hdr td.day,
tr.coll-sect-hdr td.service {
  background: var(--parchment) !important;
  color: var(--rubric) !important;
  font-family: var(--font-main);
  font-variant: small-caps;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.4rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.coll-sect-arrow {
  margin-left: 0.5em;
  font-style: normal;
  font-variant: normal;
}
.coll-sect-orn { margin-right: 0.3em; }
