/* ── St. Mary Catholic Church · site.css ── */

/* Body & links (replaces deprecated link/vlink/alink body attrs) */
body {
  background-color: #eaf6ff;        /* light sky-blue fallback if the tile image is missing */
  /* Translucent light-blue wash laid OVER the cloud tile so it reads as a light sky rather
     than the tile's native periwinkle. Raise the 0.78 alpha for lighter/flatter; lower it
     to let more of the cloud texture show through. (multiply can't go lighter than the tile.) */
  background-image: linear-gradient(rgba(224,240,252,0.52), rgba(224,240,252,0.52)), url('images/background_021.jpg');
}
a         { color: darkblue; }
a:visited { color: darkslategray; }
a:active  { color: teal; }

/* ── Outer layout table ── */
body > table {
  width: 80%;
  table-layout: fixed;
  margin-left: auto;
  margin-right: auto;
}
body > table td {
  padding: 5px;
  vertical-align: top;
}

/* ── Header: logo cell — defines column 1 width for all rows ── */
body > table > tbody > tr:first-child > td:first-child {
  width: 240px;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ── Header: title cell ── */
.site-title-main {
  font-family: cursive;
  font-size: 24pt;
  font-weight: bold;
  text-align: center;
}
.site-title-sub {
  font-family: cursive;
  font-size: 14pt;
  font-weight: normal;
  text-align: center;
}

/* ── Left nav column ── */
.site-nav-inner {
  position: sticky;
  top: 167px;
}

/* All top-level items share the same style */
.site-nav h5,
.site-nav p.nav-category {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85em;
  font-weight: bold;
  margin: 0 0 0.1em 0;
  padding-top: 0.55em;
  border-top: 1px solid rgba(0,0,0,0.18);
  color: #00006a;
}
.site-nav > *:first-child {
  border-top: none;
  padding-top: 0;
}

/* Sub-links */
.site-nav p {
  margin: 0 0 0 10px;
  font-size: 0.85em;
}

.site-nav a { color: #00006a; }
.site-nav p a { display: block; padding: 2px 0; }

/* ── Main content cell ── */
body > table > tbody > tr:nth-child(2) > td:nth-child(2) {
  background-image: url('images/background_015.jpg');
  color: rgb(82, 64, 32);
}
.site-content {
  font-family: Garamond, serif;
}
.site-content h1 {
  font-family: Garamond, serif;
  font-size: 1.5em;
  text-align: center;
}
.site-content h2 {
  font-family: Garamond, serif;
  font-size: 1.15em;
  color: darkblue;
  margin-bottom: 0.1em;
}
.heading-sub {
  text-align: center;
  font-family: Garamond, serif;
  font-size: 0.88em;
  color: darkblue;
  opacity: 0.65;
  margin-top: 0;
  margin-bottom: 0.9em;
  font-style: italic;
}
.site-content h3 {
  font-family: Garamond, serif;
  font-size: 1em;
  font-weight: bold;
}

/* ── Footer cell ── */
body > table > tbody > tr:last-child > td {
  text-align: center;
}
body > table > tbody > tr:last-child hr {
  color: darkblue;
  background-color: darkblue;
  width: 95%;
  border: none;
  height: 1px;
}
body > table > tbody > tr:last-child address {
  font-style: normal;
  font-size: 0.8em;
  font-family: Arial, Helvetica, sans-serif;
}

/* ── Phase 2 utility classes ── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.alert-text   { color: red; }
.clear-right  { clear: right; }
.clear-left   { clear: left; }
.clear-both   { clear: both; }

/* Floated images (replaces inline float+margin styles) */
.img-float-right { float: right; margin: 0 0 15px 15px; }
.img-float-left  { float: left;  margin: 0 15px 15px 0; }
.img-float-right figcaption,
.img-float-left  figcaption {
  font-size: 0.82em;
  text-align: center;
  font-style: italic;
  margin-top: 3px;
}

/* Ministry images — floated inline with text, scale with content column */
/* Floated content photo — shared by the ministries and sacraments pages.
   Default is a 4:3 crop; add .content-photo-natural to keep the image's own ratio. */
.content-photo-right { float: right; margin: 0 0 15px 15px; width: 35%; max-width: 360px; min-width: 200px; aspect-ratio: 4/3; object-fit: cover; display: block; }
.content-photo-left  { float: left;  margin: 0 15px 15px 0; width: 35%; max-width: 360px; min-width: 200px; aspect-ratio: 4/3; object-fit: cover; display: block; }
.content-photo-natural { aspect-ratio: auto; } /* opt out of the 4/3 crop: keep width cap, follow the image's natural height */

/* Fragment layout tables (replaces cellpadding/cellspacing/align/border attrs) */
.layout-table { border-spacing: 5px; }

/* Policy document image */
.policy-img { width: 100%; height: auto; display: block; object-fit: contain; }

/* Photo gallery images — block with caption below */
.gallery-photo { width: 50%; height: auto; display: block; margin: 1em 0 0.4em 0; }

/* Google Maps iframe embed */
.map-frame { border: none; overflow: hidden; }

/* Council/leadership org chart tables */
.org-table { width: 100%; }
.org-table td { text-align: center; width: 33.3333%; }

/* Council member list table */
.council-list-table { width: 100%; border-collapse: collapse; }
.council-list-table td { text-align: center; width: 33.3333%; }

/* ── Utility classes used by page fragments ── */
.compareTable th,
.compareTable td {
  padding: 15px;
  vertical-align: top;
}
.compareTable tr:nth-of-type(even) {
  background-color: #f2f2f2;
}
.compareTable {
  border-collapse: separate;
  border-spacing: 0 30px;
}
/* compareTable column widths (replaces deprecated width= attrs on th) */
.compareTable th:nth-child(1) { width: 30%; }
.compareTable th:nth-child(2),
.compareTable th:nth-child(3) { width: 35%; }
.red-title-link {
  color: #C41E3A;
  font-weight: bold;
}
.red-title-link:hover {
  color: #C41E3A;
}

/* ── Event header (upcoming / recent pages) ── */
.event-header {
  display: flex;
  align-items: stretch;
  margin: 1.2em 0 0.4em 0;
}
.event-when {
  background: darkblue;
  color: white;
  padding: 6px 12px;
  width: 104px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82em;
  flex-shrink: 0;
  line-height: 1.5;
}
.event-when-date { font-weight: bold; }
.event-title-block {
  flex: 1;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.15);
  border-left: none;
}
.event-title-line1 {
  font-family: Garamond, serif;
  font-weight: bold;
  color: darkblue;
  font-size: 1em;
  line-height: 1.3;
}
.event-title-line2 {
  font-family: Garamond, serif;
  font-size: 0.88em;
  color: rgb(82, 64, 32);
  margin-top: 3px;
  line-height: 1.3;
}

/* ── Mass schedule table ── */
.mass-table {
  width: auto;
  border-collapse: collapse;
  margin: 0.5em auto 1.5em auto;
}
.mass-table thead th {
  color: darkblue;
  text-align: center;
  padding: 6px 32px 6px 10px;
  font-family: Garamond, serif;
  font-size: 1.05em;
  border-bottom: 2px solid darkblue;
}
.mass-table td {
  padding: 7px 32px 7px 10px;
  border-bottom: 1px solid #ddd;
}
.mass-table td:first-child { font-weight: bold; width: 55%; }
.mass-table td:last-child  { text-align: right; }
.mass-table tr:last-child td { border-bottom: none; }

/* ── Block image utility ── */
.block-img { width: 100%; height: auto; display: block; }

/* ── Map page wrapper ── */
.map-wrapper { width: 100%; }

/* ── Index page altar image ── */
.altar-img { width: 75%; height: auto; display: block; }

/* ── Affiliate banner (scales down if content cell is narrower than banner) ── */
.affiliate-banner { max-width: 100%; height: auto; display: block; }

/* ── Contacts page ── */
.contacts-grid {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
.contacts-grid td {
  padding: 14px 16px;
  border: 1px solid #ddd;
  width: 50%;
  vertical-align: top;
}
.contact-role {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78em;
  font-weight: bold;
  color: darkblue;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 4px;
}
.contact-name {
  font-size: 1.1em;
  font-family: Garamond, serif;
  display: block;
}

/* ── Upcoming / recent events ── */
.ongoing-link         { color: #00006a; font-weight: bold; font-family: Arial, Helvetica, sans-serif; font-size: 0.95em; }
.ongoing-link:visited { color: #00006a; }

/* ── Ministries page ── */
.coordinator-info {
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ── Council / leadership grid ── */
.council-grid {
  width: 80%;
  min-width: 380px;
  margin: 0 auto 1.5em auto;
  border-collapse: collapse;
}
.council-grid thead th {
  color: darkblue;
  text-align: center;
  padding: 6px 10px;
  font-family: Garamond, serif;
  font-size: 1.05em;
  border-bottom: 2px solid darkblue;
}
.council-grid td {
  width: 33.333%;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid #ddd;
  vertical-align: top;
}
.council-grid .role {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82em;
  font-weight: bold;
  color: darkblue;
  display: block;
  margin-bottom: 2px;
}
.council-grid .name {
  display: block;
}

/* ── Sacraments page ── */
/* ── Inline sacrament photo (used by psr.html) ── */
.sacrament-photo {
  width: calc(50% - 5px);
  margin: 0 0 1em 0;
  text-align: center;
}
.sacrament-photo img {
  width: 100%;
  height: auto;
  display: block;
}
.sacrament-photo figcaption {
  font-size: 0.85em;
  margin-top: 4px;
}

/* ── December / seasonal schedule page ── */
:root {
  --advent-purple: #4b2e83;
  --advent-rose:   #c97ca9;
}
.st-mary-advent {
  max-width: 42rem;
  margin: 0 auto 2rem;
  padding: 1rem 0;
}
.st-mary-advent h1 {
  text-align: center;
  color: var(--advent-purple);
  margin-bottom: 0.5rem;
}
.st-mary-advent ul {
  margin: 0 0 1.5rem 1.25rem;
  padding: 0;
}
.st-mary-advent li {
  margin: 0.15rem 0;
}
.st-mary-advent section {
  margin: 2rem 0;
}
.mass-row,
.mass-heading-row {
  display: grid;
  grid-template-columns: 8.75rem 1fr;
  column-gap: 1rem;
  align-items: start;
  margin: 0.25rem 0;
}
.mass-heading-row {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--advent-rose);
}
.heading-left {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.heading-dow,
.heading-date {
  text-transform: uppercase;
  font-size: 0.9rem;
  font-weight: bold;
  color: #555;
  white-space: nowrap;
}
.heading-feast {
  font-weight: bold;
  color: var(--advent-purple);
  font-size: 1.05rem;
}
.mass-time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mass-time.st-mary,
.mass-detail.st-mary {
  font-weight: bold;
}
.st-mary-advent hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 2rem 0;
}

/* Hidden on desktop, shown in mobile nav */
.nav-home-link { display: none; }

/* ── Mobile / hamburger menu ── */

.hamburger-btn {
  display: none;
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  background: darkblue;
  color: white;
  border: none;
  padding: 6px 11px;
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
}
.hamburger-btn.nav-hint {
  animation: nav-pulse 1s ease-out 3;
}
.hamburger-btn.nav-hint::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 10px;
  border: 6px solid transparent;
  border-bottom-color: darkblue;
  pointer-events: none;
}
.hamburger-btn.nav-hint::after {
  content: "New menu here!";
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  background: white;
  color: darkblue;
  font-size: 0.55em;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid darkblue;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  pointer-events: none;
}

@media (max-width: 640px) {
  @keyframes nav-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  }

  .hamburger-btn { display: block; }

  /* Flatten table into block flow */
  body > table,
  body > table > tbody,
  body > table > tbody > tr,
  body > table > tbody > tr > td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Header: hide the logo cell; title sits to the right of the hamburger button */
  body > table > tbody > tr:first-child > td:first-child { display: none !important; }
  body > table > tbody > tr:first-child > td:last-child {
    padding: 6px 10px 8px 64px !important;
  }

  /* Title fonts: Georgia instead of cursive on mobile */
  .site-title-main {
    font-family: Garamond, serif;
    font-size: 20pt;
    text-align: left;
  }
  .site-title-sub {
    font-family: Garamond, serif;
    font-size: 13pt;
    text-align: left;
  }

  /* Home link: link style, same weight as category headings */
  .nav-home-link {
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85em;
    font-weight: bold;
    color: #00006a;
    margin-bottom: 0.6em;
    padding-bottom: 0.55em;
    border-bottom: 1px solid rgba(0,0,0,0.18);
  }

  /* Cancel sticky nav */
  .site-nav-inner { position: static; }

  /* Larger tap targets for nav links — min 44px touch area */
  .site-nav a {
    display: block;
    padding: 8px 0;
    font-size: 1em;
  }
  /* Section headings: more space above (separates sections), less below (groups with links) */
  .site-nav p.nav-category {
    margin-top: 8px;
    padding-top: 6px;
    margin-bottom: 0;
  }

  /* Floated images stack and go full-width on mobile */
  .img-float-right,
  .img-float-left {
    float: none !important;
    display: block;
    margin: 0 auto 15px auto;
    max-width: 100%;
    height: auto;
  }
  .content-photo-right,
  .content-photo-left {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 0 15px 0;
  }
  .sacrament-photo {
    width: 100% !important;
  }

  /* Nav hidden by default; full-screen overlay when open */
  td.site-nav { display: none !important; }
  td.site-nav.nav-open {
    display: block !important;
    position: fixed !important;
    inset: 0;
    z-index: 100;
    overflow-y: auto;
    background: white;
    padding: 50px 24px 24px !important;
  }
}
