/* Avery Lodge No. 493: site styles */

:root {
  --navy: #0f2042;
  --navy-2: #1b3366;
  --navy-3: #2a4a8a;
  --gold: #c89b2c;
  --gold-2: #e2b847;
  --gold-soft: #f6ecd2;
  --cream: #fbf8f2;
  --paper: #ffffff;
  --ink: #1b1f29;
  --muted: #5d6474;
  --line: #e6e0d3;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 32 66 / 6%), 0 8px 24px rgb(15 32 66 / 8%);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-3); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--navy); letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

.container { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.prose { max-width: 44rem; }
.container.prose { width: min(44rem, 100% - 2rem); }

.skip { position: absolute; left: -999px; top: 0; background: var(--gold-2); color: var(--navy); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.25rem; border-radius: 999px; border: 2px solid var(--navy);
  background: var(--navy); color: #fff; font: 600 .975rem/1 var(--sans);
  text-decoration: none; cursor: pointer; transition: transform .15s, background .15s;
}
.btn:hover { background: var(--navy-2); color: #fff; transform: translateY(-1px); }
.btn-gold { background: var(--gold-2); border-color: var(--gold-2); color: var(--navy); }
.btn-gold:hover { background: #ebc65c; color: var(--navy); }
.btn-ghost { background: transparent; border-color: rgb(255 255 255 / 70%); color: #fff; }
.btn-ghost:hover { background: rgb(255 255 255 / 12%); }
.btn-outline { background: transparent; color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.text-link { font-weight: 600; text-decoration: none; color: var(--navy-3); }
.text-link::after { content: " →"; }
.text-link:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(15 32 66 / 97%); color: #fff;
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 3px solid var(--gold);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { width: 44px; height: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font: 600 1.3rem/1.1 var(--serif); }
.brand small { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2); }

.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav > ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav li { position: relative; }
.site-nav a { color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem; display: block; padding: .5rem .75rem; border-radius: 8px; }
.site-nav > ul > li > a:hover, .site-nav > ul > li > a[aria-current] { background: rgb(255 255 255 / 10%); color: var(--gold-2); }
.site-nav .has-children > a::after { content: ""; display: inline-block; margin-left: .35rem; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.site-nav li ul {
  list-style: none; margin: 0; padding: .4rem; position: absolute; left: 0; top: 100%; min-width: 14rem;
  background: #fff; border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s;
}
.site-nav li:hover > ul, .site-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: none; }
.site-nav li ul a { color: var(--ink); }
.site-nav li ul a:hover, .site-nav li ul a[aria-current] { background: var(--gold-soft); color: var(--navy); }
.nav-cta.btn { padding: .6rem 1.1rem; color: var(--navy); }

.menu-toggle { display: none; align-items: center; gap: .5rem; background: none; border: 1px solid rgb(255 255 255 / 35%); color: #fff; border-radius: 8px; padding: .5rem .8rem; font: 600 .95rem var(--sans); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: .2s; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
.menu-open .menu-icon { background: transparent; }
.menu-open .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-icon::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 62rem) {
  .js-menu .menu-toggle { display: inline-flex; }
  .site-nav { flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .75rem; padding-bottom: 1rem; }
  .js-menu .site-nav { display: none; }
  .js-menu.menu-open .site-nav { display: flex; }
  .site-nav > ul { flex-direction: column; }
  .site-nav a { padding: .65rem .5rem; font-size: 1.05rem; }
  .site-nav li ul { position: static; opacity: 1; visibility: visible; transform: none; background: none; border: 0; box-shadow: none; padding: 0 0 0 1rem; }
  .site-nav li ul a { color: rgb(255 255 255 / 80%); font-size: .98rem; }
  .site-nav li ul a:hover, .site-nav li ul a[aria-current] { background: rgb(255 255 255 / 8%); color: var(--gold-2); }
  .site-nav .has-children > a::after { display: none; }
  .nav-cta.btn { align-self: flex-start; }
}

/* Home hero */
.announcement { background: var(--gold-2); color: var(--navy); font-weight: 600; text-align: center; padding: .65rem 0; }
.announcement a { color: var(--navy); }
.hero { position: relative; color: #fff; overflow: hidden; background: var(--navy); isolation: isolate; }
.hero picture, .hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg, .hero picture img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgb(15 32 66 / 94%) 0%, rgb(15 32 66 / 82%) 45%, rgb(15 32 66 / 45%) 100%); }
.hero-inner { padding: clamp(4rem, 11vw, 8rem) 0 clamp(4rem, 10vw, 7rem); max-width: 72rem; }
.hero h1 { color: #fff; max-width: 15ch; }
.hero .lede { max-width: 38rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: rgb(255 255 255 / 88%); }
.hero .eyebrow { color: var(--gold-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.eyebrow { font: 600 .8rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: .9rem; }
.eyebrow a { color: inherit; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.band { background: var(--navy); color: rgb(255 255 255 / 88%); }
.band h2 { color: #fff; }
.band .text-link { color: var(--gold-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: center; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.facts div { border: 1px solid rgb(255 255 255 / 15%); border-radius: var(--radius); padding: 1.25rem; background: rgb(255 255 255 / 4%); }
.facts strong { display: block; font: 600 2.2rem/1 var(--serif); color: var(--gold-2); margin-bottom: .35rem; }
.facts span { font-size: .92rem; color: rgb(255 255 255 / 75%); }
.visit .address { font-size: 1.1rem; }
.rounded, .rounded img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

/* Cards */
.cards-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.link-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.link-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgb(15 32 66 / 8%), 0 16px 36px rgb(15 32 66 / 14%); color: inherit; }
.link-card img, .link-card picture { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; }
.link-card picture img { height: 100%; }
.link-card > div { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.link-card h2, .link-card h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.link-card p { color: var(--muted); font-size: .98rem; }
.link-card .more { margin-top: auto; font-weight: 600; color: var(--navy-3); }
.link-card .more::after { content: " →"; }
.post-card time { font-size: .85rem; color: var(--gold); font-weight: 600; letter-spacing: .02em; margin-bottom: .35rem; }
.card-placeholder { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--navy), var(--navy-3)); display: grid; place-items: center; }
.card-placeholder img { width: 64px; aspect-ratio: auto; opacity: .9; }

/* Inner pages */
.page-hero { background: var(--navy); color: #fff; padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); border-bottom: 1px solid var(--navy-2); }
.page-hero h1 { color: #fff; margin-bottom: .35em; }
.page-hero .lede { color: rgb(255 255 255 / 82%); font-size: 1.15rem; max-width: 42rem; margin: 0; }
.page-hero .eyebrow { color: var(--gold-2); }
.subnav { background: var(--paper); border-bottom: 1px solid var(--line); }
.subnav .container { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.subnav a { white-space: nowrap; padding: .9rem .9rem; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; border-bottom: 3px solid transparent; }
.subnav a:hover { color: var(--navy); }
.subnav a[aria-current] { color: var(--navy); border-bottom-color: var(--gold); }
.page-body { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 5rem); }

.prose h2 { margin-top: 2.2em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--gold); }
.prose ol > li::marker { font-weight: 700; }
.prose blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: 1.1rem; color: #333a4a; }
.prose img, .prose picture { border-radius: var(--radius); margin: 1.5em 0; }
.prose table { width: 100%; }
.credit, .note { font-size: .9rem; color: var(--muted); }
.cta-box { background: var(--gold-soft); border: 1px solid #ead9a8; border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 2em 0; }
.cta-box p:last-child { margin: 0; }
.video { position: relative; aspect-ratio: 16 / 9; margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-cover { margin: 0 0 2rem; }
.post-cover img { border-radius: var(--radius); margin: 0; width: 100%; }
.back { margin-top: 3rem; }
.pager { display: flex; justify-content: space-between; margin-top: 2rem; font-weight: 600; }

/* People grids (officers, past masters) */
.intro { margin-bottom: 2.5rem; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.people.compact { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 1.25rem 1rem; }
.person { text-align: center; }
.person img, .person picture, .person .avatar { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--gold-soft); margin-bottom: .6rem; }
.person picture img { margin: 0; height: 100%; }
.compact .person img { object-position: center 20%; background: none; }
.avatar { display: grid; place-items: center; font: 600 2rem var(--serif); color: var(--navy); background: linear-gradient(160deg, var(--gold-soft), #ecdcb1); }
.person p { margin: 0; line-height: 1.3; }
.person .name { font-weight: 600; }
.person .role { font-size: .85rem; color: var(--muted); }
.people:not(.compact) .person .role { color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; margin-bottom: .15rem; }
.era { margin-top: 3rem; }
.era h2 { border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin-bottom: 1.5rem; }

.table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--navy); color: #fff; font-weight: 600; font-size: .9rem; letter-spacing: .03em; }
.table tr:last-child td { border-bottom: 0; }
.table td:last-child, .table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Calendar & contact */
.calendar-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; border: 1px solid var(--line); }
.calendar-embed iframe { display: block; width: 100%; height: min(75vh, 44rem); border: 0; }
.contact { align-items: start; }
.form { padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; color: var(--navy); }
.form .optional { font-weight: 400; color: var(--muted); }
.form input, .form select, .form textarea { font: inherit; font-weight: 400; color: var(--ink); width: 100%; padding: .7rem .85rem; border: 1px solid #cfc7b6; border-radius: 10px; background: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px solid rgb(226 184 71 / 45%); border-color: var(--gold); }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.alert { background: #fdecea; border: 1px solid #f3b7b0; color: #8a1c12; padding: .8rem 1rem; border-radius: 10px; }
.contact-info h2 { font-size: 1.2rem; margin: 1.5rem 0 .4rem; }
.contact-info h2:first-child { margin-top: 0; }
.map { margin-top: 1.5rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map iframe { display: block; width: 100%; height: 18rem; border: 0; }

/* Footer */
.site-footer { background: #0a1730; color: rgb(255 255 255 / 75%); padding: 3.5rem 0 1.5rem; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--gold-2); }
.site-footer h2 { font: 600 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); margin-bottom: .9rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.footer-brand { display: flex; align-items: center; gap: .6rem; font: 600 1.15rem var(--serif); color: #fff; }
.footer-brand img { width: 36px; }
.site-footer .muted { color: rgb(255 255 255 / 60%); }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / 12%); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .85rem; color: rgb(255 255 255 / 55%); }
.footer-bottom p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.links { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.links h3 { margin-top: 1.5rem; font-size: 1.1rem; }
