/* =====================================================================
   Ca Đoàn Hiển Linh — site styles
   ===================================================================== */
:root {
  --night: #1b2547;
  --night-2: #273566;
  --night-3: #34457e;
  --star: #e0b54a;
  --star-soft: #f5e6b8;
  --paper: #f6f7fb;
  --white: #ffffff;
  --ink: #1d2335;
  --muted: #5a6279;
  --line: #dde1ec;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  --measure: 68ch;
  --wrap: 1120px;
  --radius-s: 6px;
  --radius-m: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img, video { max-width: 100%; display: block; }
a { color: var(--night-3); text-underline-offset: 3px; }
a:hover { color: var(--night); }
:focus-visible { outline: 3px solid var(--star); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--star); color: var(--night); padding: 8px 14px; z-index: 50; border-radius: var(--radius-s); }
.skip:focus { left: 16px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--night); }
h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; max-width: var(--measure); }

/* ---------- Header ---------- */
.site-header { background: var(--night); color: var(--white); position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; white-space: nowrap; }
.brand:hover { color: var(--star-soft); }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.35); color: var(--white); border-radius: var(--radius-s); padding: 8px 12px; font: inherit; font-size: .95rem; cursor: pointer; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav a { display: block; padding: 8px 12px; color: rgba(255,255,255,.86); text-decoration: none; font-size: .95rem; border-radius: var(--radius-s); }
.site-nav a:hover { color: var(--white); background: rgba(255,255,255,.08); }
.site-nav a[aria-current="page"] { color: var(--night); background: var(--star); }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--night); border-top: 1px solid rgba(255,255,255,.12); display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .site-nav a { padding: 12px; font-size: 1.05rem; }
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--white); text-align: center;
  background:
    radial-gradient(ellipse 60% 55% at 50% 18%, rgba(224,181,74,.22), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 70%, var(--night-3) 100%);
  padding: 56px 0 72px;
}
.hero .sky { position: absolute; inset: 0; pointer-events: none; }
.hero .sky i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: rgba(255,255,255,.7); }
.hero-star { width: clamp(120px, 22vw, 190px); margin: 0 auto 8px; position: relative; }
.hero-star svg { width: 100%; height: auto; overflow: visible; }
.hero-star .ray { transform-origin: 100px 100px; }
.hero h1 { color: var(--white); margin-bottom: .2em; }
.hero .where { color: var(--star-soft); font-size: 1.05rem; margin: 0 auto 28px; max-width: none; }
.hero blockquote { margin: 0 auto; max-width: 34em; font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.5; color: rgba(255,255,255,.9); }
.hero blockquote p { max-width: none; margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero-star .glow { animation: glow 3.2s ease-out 1 both; }
  .hero-star .ray { animation: ray 1.8s cubic-bezier(.2,.7,.2,1) .2s 1 both; }
  .hero h1, .hero .where, .hero blockquote { animation: rise .9s ease-out both; }
  .hero h1 { animation-delay: .9s; }
  .hero .where { animation-delay: 1.05s; }
  .hero blockquote { animation-delay: 1.25s; }
}
@keyframes glow { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes ray { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%); color: var(--white); padding: 40px 0 44px; }
.page-head h1 { color: var(--white); font-size: clamp(2.1rem, 5vw, 3.2rem); margin-bottom: .15em; }
.page-head p { color: rgba(255,255,255,.82); margin: 0; }

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: 56px 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.more { font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }

/* weekly facts */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); margin: -36px auto 0; position: relative; z-index: 2; }
.facts div { padding: 20px 24px; }
.facts div + div { border-left: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 2px 0 0; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--night); line-height: 1.25; }
.facts dd small { display: block; font-family: var(--sans); font-size: .95rem; font-weight: 400; color: var(--ink); }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; }
  .facts div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* this month */
.month-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; padding: 0; margin: 0; list-style: none; }
.month-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.month-list .d { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.month-list .k { color: var(--muted); font-size: .9rem; }
.month-list .today { font-weight: 700; }
.month-list .today .d { color: var(--night); }

/* motto band */
.motto { background: var(--night); color: var(--white); text-align: center; padding: 56px 0; }
.motto p { margin: 0 auto; max-width: none; font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 600; line-height: 1.15; color: var(--star-soft); }
.motto span { display: block; margin-top: 10px; font-family: var(--sans); font-size: .95rem; color: rgba(255,255,255,.75); }

/* ---------- Photo grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.grid.lead { grid-template-columns: repeat(4, 1fr); }
.grid.lead button:first-child { grid-column: span 2; grid-row: span 2; }
@media (max-width: 760px) { .grid.lead { grid-template-columns: repeat(2, 1fr); } }
.grid button { all: unset; cursor: zoom-in; display: block; aspect-ratio: 1; background: var(--line); border-radius: var(--radius-s); overflow: hidden; position: relative; }
.grid button:focus-visible { outline: 3px solid var(--star); outline-offset: 2px; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.grid button:hover img { transform: scale(1.03); }
.grid img.broken { opacity: 0; }
.grid button.broken-tile { display: none; }

/* ---------- Gallery page ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.filters button { font: inherit; font-size: .95rem; border: 1px solid var(--line); background: var(--white); color: var(--ink); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.filters button:hover { border-color: var(--night-3); }
.filters button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--white); }
.album { padding: 28px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.album:first-child { border-top: 0; padding-top: 0; }
.album h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .1em; }
.album .meta { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.album video { width: 100%; max-width: 820px; border-radius: var(--radius-m); background: #000; }
.album .dl { margin-top: 10px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12,17,36,.94); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 94vw; max-height: 80vh; object-fit: contain; border-radius: 4px; }
.lightbox figcaption { color: rgba(255,255,255,.8); font-size: .95rem; margin-top: 10px; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,.1); color: var(--white); border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lightbox .close { top: 14px; right: 14px; }
.lightbox .prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox .prev, .lightbox .next { top: auto; bottom: 18px; transform: none; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 28px; } }
.about figure { margin: 0; }
.about figure img { border-radius: var(--radius-m); width: 100%; }
.about figcaption { font-family: var(--serif); font-style: italic; font-size: 1.25rem; line-height: 1.5; color: var(--night); margin-top: 18px; }
.about dl { margin: 0; }
.about dt { font-weight: 600; color: var(--night); margin-top: 18px; }
.about dt:first-child { margin-top: 0; }
.about dd { margin: 2px 0 0; }

/* ---------- Tables / lists ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: 32px; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); font-size: .9rem; background: var(--paper); }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }

.patrons { columns: 3 280px; column-gap: 32px; }
.patron { break-inside: avoid; margin: 0 0 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; }
.patron h3 { font-size: 1.35rem; margin: 0; }
.patron .feast { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.patron ul { list-style: none; margin: 0; padding: 0; }
.patron li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--line); font-size: .98rem; }
.patron li span:last-child { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.patron.now { border-color: var(--star); box-shadow: 0 0 0 1px var(--star) inset; }

.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px 32px; }
.months h3 { font-size: 1.3rem; border-bottom: 2px solid var(--star); padding-bottom: 4px; margin-bottom: 6px; }
.months ul { list-style: none; margin: 0; padding: 0; }
.months li { padding: 5px 0; display: flex; justify-content: space-between; gap: 10px; font-size: .98rem; }
.months li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* recordings */
.disc { margin-bottom: 40px; }
.tracks { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 32px; }
.tracks li { break-inside: avoid; display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.tracks button { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--night); color: var(--white); cursor: pointer; display: grid; place-items: center; }
.tracks button[aria-pressed="true"] { background: var(--star); color: var(--night); }
.tracks .n { color: var(--muted); font-variant-numeric: tabular-nums; width: 2ch; text-align: right; flex: none; font-size: .9rem; }
.player { position: sticky; bottom: 0; background: var(--night); color: var(--white); padding: 12px 0; display: none; z-index: 10; }
.player.show { display: block; }
.player .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.player strong { font-family: var(--serif); font-size: 1.2rem; }
.player audio { flex: 1 1 260px; }
.note { background: var(--star-soft); border-radius: var(--radius-m); padding: 14px 18px; margin-bottom: 28px; max-width: none; }

/* contact */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 40px; }
.person { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; }
.person .role { color: var(--muted); font-size: .9rem; margin: 0; }
.person .name { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--night); margin: 0; line-height: 1.25; }
.visit { display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .visit { grid-template-columns: 1fr; } }
.visit address { font-style: normal; font-size: 1.1rem; line-height: 1.7; }
.map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius-m); background: var(--line); }

.links { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.links a { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; text-decoration: none; }
.links a:hover { border-color: var(--night-3); }

.empty { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: rgba(255,255,255,.78); padding: 40px 0 28px; margin-top: 0; font-size: .95rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.site-footer strong { color: var(--white); font-family: var(--serif); font-size: 1.3rem; font-weight: 600; display: block; margin-bottom: 4px; }
.site-footer a { color: var(--star-soft); }
.site-footer address { font-style: normal; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.site-footer .copy { grid-column: 1 / -1; max-width: none; margin: 0; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; color: rgba(255,255,255,.6); }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.tracks .t small { color: var(--muted); font-size: .85rem; }

/* =========================================================
   MENU SỐNG ĐỘNG — dán đoạn này vào CUỐI assets/css/site.css
   (không cần sửa trang .htm nào)
   ========================================================= */

/* Viền vàng mỏng dưới thanh menu */
.site-header { box-shadow: 0 1px 0 rgba(224,181,74,.35), 0 6px 18px rgba(0,0,0,.18); }

/* Ngôi sao logo xoay nhẹ khi rê chuột */
.brand img, .brand svg { transition: transform .6s ease; }
.brand:hover img, .brand:hover svg { transform: rotate(72deg) scale(1.12); }

/* Menu gọn lại để vừa một hàng trên máy tính */
@media (min-width: 1101px) {
  .site-nav ul { flex-wrap: nowrap; gap: 0; }
  .site-nav a { padding: 8px 9px; font-size: .9rem; white-space: nowrap; }
  .site-nav a::after { left: 9px; right: 9px; }
}

/* Gạch vàng trượt ra dưới chữ khi rê chuột */
.site-nav a { position: relative; transition: color .2s, background-color .2s, transform .2s; }
.site-nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  border-radius: 2px; background: var(--star);
  transform: scaleX(0); transform-origin: center; transition: transform .25s ease;
}
.site-nav a:hover { transform: translateY(-1px); }
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }

/* Trang đang xem: nút vàng phát sáng + ngôi sao lấp lánh */
.site-nav a[aria-current="page"] {
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(224,181,74,.6), 0 0 16px rgba(224,181,74,.45);
}
.site-nav a[aria-current="page"]::after { display: none; }
.site-nav a[aria-current="page"]::before {
  content: "✦"; display: inline-block; margin-right: 6px; font-size: .8em;
  animation: hl-twinkle 2.4s ease-in-out infinite;
}
@keyframes hl-twinkle {
  0%, 100% { opacity: 1;   transform: scale(1)  rotate(0); }
  50%      { opacity: .55; transform: scale(.8) rotate(25deg); }
}

/* Điện thoại: menu trượt xuống, từng mục hiện lần lượt */
@media (max-width: 1100px) {
  .nav-toggle { transition: background-color .2s, color .2s, border-color .2s; }
  .nav-toggle[aria-expanded="true"] { background: var(--star); color: var(--night); border-color: var(--star); }

  .site-nav {
    display: block; visibility: hidden; opacity: 0; transform: translateY(-10px);
    box-shadow: 0 14px 28px rgba(0,0,0,.3);
    transition: opacity .25s, transform .25s, visibility 0s .25s;
  }
  .site-nav.open { visibility: visible; opacity: 1; transform: none; transition: opacity .25s, transform .25s; }

  .site-nav li { opacity: 0; transform: translateX(-12px); transition: opacity .3s, transform .3s; }
  .site-nav.open li { opacity: 1; transform: none; }
  .site-nav.open li:nth-child(2) { transition-delay: .04s; }
  .site-nav.open li:nth-child(3) { transition-delay: .08s; }
  .site-nav.open li:nth-child(4) { transition-delay: .12s; }
  .site-nav.open li:nth-child(5) { transition-delay: .16s; }
  .site-nav.open li:nth-child(6) { transition-delay: .20s; }
  .site-nav.open li:nth-child(7) { transition-delay: .24s; }
  .site-nav.open li:nth-child(8) { transition-delay: .28s; }

  .site-nav a::after { right: auto; width: 32px; transform-origin: left; }
  .site-nav a:hover { transform: translateX(4px); }
}

/* Người tắt hiệu ứng chuyển động trong máy: giữ menu đứng yên */
@media (prefers-reduced-motion: reduce) {
  .site-nav, .site-nav *, .site-nav *::before, .site-nav *::after, .brand img, .brand svg {
    transition: none !important; animation: none !important;
  }
}
