/*
Theme Name: St. John Glendale
Description: Bilingual (English / Romanian) theme for St. John the Baptist Romanian Orthodox Church, Glendale, Arizona.
Version: 1.0.4
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: stjohn
*/

:root {
  --burgundy: #6b1220;
  --burgundy-dark: #4a0c16;
  --gold: #b8892b;
  --gold-soft: #e9d9b0;
  --cream: #faf6ee;
  --paper: #ffffff;
  --ink: #2a2320;
  --muted: #6d625b;
  --line: #e4dccd;
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--burgundy); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--burgundy-dark);
  margin: 1.6em 0 .5em;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.45rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto;
  clip: auto; background: var(--paper); padding: 8px 14px; border-radius: 4px;
}

/* Top bar */
.topbar { background: var(--burgundy-dark); color: var(--gold-soft); font-size: .88rem; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.topbar a { color: var(--gold-soft); text-decoration: none; }
.topbar a:hover { color: #fff; }
.lang-switch { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.lang-switch a { display: block; padding: 2px 10px; border: 1px solid rgba(233, 217, 176, .4); border-radius: 999px; }
.lang-switch .current-lang a { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Header */
.site-header { background: var(--paper); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--burgundy-dark); min-width: 0; }
.brand-logo { flex: none; width: 76px; height: 76px; display: block; }
.footer-logo { width: 120px; height: 120px; display: block; margin-bottom: 14px; }
.brand-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; line-height: 1.1; display: block; }
.brand-sub { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: block; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font: inherit; color: var(--burgundy-dark); cursor: pointer; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .98rem; border-radius: 6px; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_parent > a { background: var(--cream); color: var(--burgundy); }

/* Dropdown menus */
.main-nav li { position: relative; }
.main-nav .menu-item-has-children > a::after { content: ""; display: inline-block; margin-left: 6px; vertical-align: middle; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; flex-direction: column; flex-wrap: nowrap; gap: 0; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 0 0 8px 8px; box-shadow: 0 12px 24px rgba(0, 0, 0, .12); padding: 6px; z-index: 60; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.main-nav .sub-menu a { font-weight: 400; white-space: nowrap; }
.main-nav .current-menu-ancestor > a { background: var(--cream); color: var(--burgundy); }

/* Hero */
.hero { position: relative; color: #fff; background: var(--burgundy-dark) center/cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40, 8, 14, .35), rgba(40, 8, 14, .72)); }
.hero .wrap { position: relative; padding-top: clamp(70px, 14vw, 150px); padding-bottom: clamp(60px, 10vw, 110px); max-width: 860px; text-align: center; }
.hero h1 { color: #fff; margin: 0 0 .3em; text-shadow: 0 2px 12px rgba(0, 0, 0, .4); }
.hero .kicker { text-transform: uppercase; letter-spacing: .2em; font-size: .85rem; color: var(--gold-soft); margin: 0 0 12px; }
.hero p.lead { font-family: var(--serif); font-size: clamp(1.2rem, 2.6vw, 1.5rem); font-style: italic; margin: 0 auto 28px; max-width: 640px; }
.btn { display: inline-block; padding: 12px 24px; border-radius: 6px; background: var(--gold); color: #fff; font-weight: 700; text-decoration: none; border: 2px solid var(--gold); margin: 4px; }
.btn:hover { background: #9c7422; border-color: #9c7422; color: #fff; }
.btn.ghost { background: transparent; border-color: #fff; }
.btn.ghost:hover { background: #fff; color: var(--burgundy-dark); }
.btn.dark { background: var(--burgundy); border-color: var(--burgundy); }
.btn.dark:hover { background: var(--burgundy-dark); border-color: var(--burgundy-dark); }

/* Sections */
.section { padding: clamp(40px, 7vw, 76px) 0; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { text-align: center; margin-top: 0; }
.section-title::after { content: ""; display: block; width: 64px; height: 3px; background: var(--gold); margin: 14px auto 0; }
.section-intro { text-align: center; max-width: 680px; margin: 0 auto 32px; color: var(--muted); }
.grid { display: grid; gap: 24px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 8px; padding: 24px; }
.section.alt .card { background: var(--cream); }
.card h3 { margin-top: 0; }
.card .meta { color: var(--muted); font-size: .88rem; margin: 0 0 6px; }
.card h3 a { text-decoration: none; }
.card { overflow: hidden; }
.card-thumb { display: block; margin: -24px -24px 18px; }
.card-thumb img { display: block; width: 100%; height: 200px; object-fit: cover; object-position: center 30%; }
.post-list .card.has-side-thumb .card-thumb { float: right; width: 220px; margin: -24px -24px 12px 24px; }
.post-list .card.has-side-thumb .card-thumb img { height: 190px; }
.center { text-align: center; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }

/* Schedule */
.schedule { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.schedule th, .schedule td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.schedule tr:last-child th, .schedule tr:last-child td { border-bottom: 0; }
.schedule th { font-family: var(--serif); font-size: 1.2rem; color: var(--burgundy-dark); white-space: nowrap; width: 1%; }
.schedule .time { white-space: nowrap; font-weight: 700; color: var(--burgundy); width: 1%; }
.schedule-note { color: var(--muted); font-size: .95rem; margin-top: 12px; }

/* Page content */
.page-head { background: var(--burgundy); color: #fff; padding: clamp(32px, 6vw, 60px) 0; border-bottom: 3px solid var(--gold); }
.page-head h1 { color: #fff; margin: 0; }
.page-head .meta { color: var(--gold-soft); margin: 8px 0 0; }
.content { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: clamp(22px, 5vw, 52px); margin: clamp(24px, 5vw, 48px) auto; max-width: 860px; }
.content > :first-child { margin-top: 0; }
.content > :last-child { margin-bottom: 0; }
.content blockquote, .narrow blockquote { margin: 1.4em 0; padding: 4px 22px; border-left: 4px solid var(--gold); background: var(--cream); font-family: var(--serif); font-size: 1.15rem; font-style: italic; }
.content figure { margin: 1.6em 0; }
.content figure img { border-radius: 6px; display: block; }
.content figcaption { color: var(--muted); font-size: .9rem; margin-top: 6px; text-align: center; }
.content .alignleft { float: left; margin: .3em 1.4em 1em 0; }
.content .alignright { float: right; margin: .3em 0 1em 1.4em; }
.content .aligncenter img { margin: 0 auto; }
.content .wp-block-gallery.has-nested-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.content .wp-block-gallery.has-nested-images figure.wp-block-image { display: block; width: auto !important; margin: 0; }
.content .wp-block-gallery.has-nested-images figure.wp-block-image a { display: block; height: 100%; }
.content .wp-block-gallery.has-nested-images figure.wp-block-image img { display: block; width: 100%; height: 220px; object-fit: cover; }
.content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.content table td, .content table th { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.content table th { background: var(--cream); }
.content::after { content: ""; display: table; clear: both; }
.map { width: 100%; height: 380px; border: 0; border-radius: 8px; display: block; }
.post-list { max-width: 860px; margin: clamp(24px, 5vw, 48px) auto; display: grid; gap: 20px; }
.pagination { text-align: center; margin: 24px 0 48px; }
.pagination .page-numbers { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); text-decoration: none; margin: 2px; }
.pagination .current { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }

/* Footer */
.site-footer { background: var(--burgundy-dark); color: #eadfd2; padding: 48px 0 20px; font-size: .96rem; }
.site-footer h4 { color: var(--gold-soft); font-size: 1.25rem; margin: 0 0 10px; }
.site-footer a { color: #fff; }
.site-footer .grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer .legal { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 32px; padding-top: 16px; text-align: center; color: #c9b9aa; font-size: .88rem; }

@media (max-width: 860px) {
  body { font-size: 17px; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 3px solid var(--gold); box-shadow: 0 10px 20px rgba(0, 0, 0, .1); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .main-nav .sub-menu { display: flex; position: static; min-width: 0; border: 0; border-left: 2px solid var(--gold-soft); border-radius: 0; box-shadow: none; padding: 0 0 0 10px; margin-left: 12px; }
  .main-nav .sub-menu a { white-space: normal; }
  .main-nav { max-height: calc(100vh - 120px); overflow-y: auto; }
  .brand-name { font-size: 1.15rem; }
  .brand-logo { width: 52px; height: 52px; }
  .schedule th, .schedule td { display: block; width: auto; border-bottom: 0; padding: 4px 16px; white-space: normal; }
  .schedule th { padding-top: 14px; }
  .schedule tr { display: block; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .content .alignleft, .content .alignright { float: none; margin: 1em auto; }
  .post-list .card.has-side-thumb .card-thumb { float: none; width: auto; margin: -24px -24px 18px; }
}
