@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Libre+Franklin:wght@400;600;700&display=swap');

:root {
    --stone-black: #0e0904;
    --stone-dark: #1f1309;
    --stone-brown: #3a200d;
    --house-red: #85140d;
    --house-red-hover: #a52218;
    --aged-gold: #d79f59;
    --bronze: #ad7639;
    --dark-gold: #815123;
    --warm-cream: #f6cc8c;
    --parchment: #feefcc;
    --text-muted: #d8c2a0;
    --shadow-dark: rgba(0, 0, 0, .65);
    --content-wide: 1180px;
    --content-narrow: 900px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at top right, #4c2b10 0, var(--stone-dark) 28rem, var(--stone-black) 70rem); color: var(--parchment); font-family: "Libre Franklin", Arial, sans-serif; line-height: 1.65; }
a { color: var(--warm-cream); }
a:hover { color: var(--aged-gold); }
img, video, iframe { max-width: 100%; }
button, input, textarea, select { font: inherit; }
h1, h2, h3, .wordmark, .admin-brand { font-family: Cinzel, Georgia, serif; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.75rem); margin: .25rem 0 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--parchment); color: var(--stone-black); padding: .75rem; }
.skip-link:focus { left: .75rem; top: .75rem; }
.content-wide, .content-narrow { width: min(calc(100% - 2rem), var(--content-wide)); margin-inline: auto; }
.content-narrow { max-width: var(--content-narrow); }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(14,9,4,.96); border-bottom: 2px solid var(--aged-gold); box-shadow: 0 5px 18px var(--shadow-dark); backdrop-filter: blur(8px); }
.nav-wrap { width: min(calc(100% - 2rem), var(--content-wide)); margin: auto; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { color: var(--parchment); text-decoration: none; font-weight: 700; }
.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav a { color: var(--parchment); text-decoration: none; font-weight: 700; padding: .7rem .9rem; border-radius: 4px; }
.main-nav a:hover, .main-nav a.active { background: var(--house-red); color: #fff; }
.nav-toggle { display: none; background: transparent; color: var(--parchment); border: 1px solid var(--aged-gold); padding: .45rem .7rem; }

.hero { background: #000; border-bottom: 2px solid var(--aged-gold); }
.hero img { display: block; width: 100%; max-height: 720px; object-fit: cover; object-position: center; }
.action-section { padding: 2rem 0 1rem; }
.action-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .85rem; }
.action-card { min-height: 116px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, rgba(58,32,13,.96), rgba(14,9,4,.96)); border: 1px solid var(--aged-gold); border-top: 4px solid var(--aged-gold); border-radius: 7px; padding: 1rem; color: var(--parchment); text-decoration: none; box-shadow: 0 5px 16px var(--shadow-dark); transition: transform .18s ease, background .18s ease; }
.action-card:hover { transform: translateY(-3px); background: var(--stone-brown); color: #fff; }
.action-card strong { font-family: Cinzel, Georgia, serif; font-size: 1.1rem; }
.action-card span { color: var(--text-muted); font-size: .86rem; margin-top: .35rem; }
.action-primary { border-top-color: var(--house-red); }
.action-disabled { opacity: .6; cursor: not-allowed; }

.announcement-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; margin-block: 1.5rem 2rem; padding: .8rem 1rem; background: linear-gradient(90deg, var(--stone-brown), var(--stone-dark)); border: 1px solid var(--aged-gold); border-left: 6px solid var(--house-red); box-shadow: 0 5px 16px var(--shadow-dark); overflow: hidden; }
.announcement-label, .eyebrow { color: var(--aged-gold); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.announcement-viewport { overflow: hidden; min-width: 0; }
.announcement-message { display: flex; gap: 1.5rem; align-items: center; font-weight: 700; }
.announcement-message.is-scrolling { width: max-content; min-width: 100%; padding-left: 100%; animation: ticker var(--ticker-duration, 18s) linear infinite; }
.announcement-message.paused, .announcement-message:hover { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-100%); } }
.ticker-toggle { border: 1px solid var(--aged-gold); background: transparent; color: var(--parchment); padding: .4rem .6rem; border-radius: 4px; }

.two-column { display: grid; grid-template-columns: 1.35fr .85fr; gap: 1.25rem; }
.welcome-section { padding: 1rem 0 3rem; }
.stone-card, .sermon-card, .stream-card { background: linear-gradient(150deg, rgba(31,19,9,.98), rgba(14,9,4,.98)); border: 1px solid rgba(215,159,89,.55); border-top: 4px solid var(--house-red); border-radius: 8px; padding: clamp(1rem, 3vw, 1.75rem); box-shadow: 0 7px 22px var(--shadow-dark); }
.scripture { margin: 1.5rem 0 0; border-left: 4px solid var(--aged-gold); padding: .4rem 0 .4rem 1rem; color: var(--warm-cream); font-family: Georgia, serif; font-size: 1.12rem; }
.service-card address { font-style: normal; color: var(--text-muted); }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.button-primary, .button-secondary, .danger-button { display: inline-block; border-radius: 5px; padding: .78rem 1.15rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--house-red); color: #fff; border: 1px solid var(--aged-gold); }
.button-primary:hover { background: var(--house-red-hover); color: #fff; }
.button-secondary { background: transparent; color: var(--warm-cream); border: 1px solid var(--aged-gold); }
.button-secondary:hover { background: var(--aged-gold); color: var(--stone-black); }
.resources-section { padding: 0 0 3rem; }
.resource-links { display: flex; flex-wrap: wrap; gap: .8rem; }
.resource-links a { border: 1px solid var(--aged-gold); padding: .7rem 1rem; text-decoration: none; border-radius: 4px; }

.page-heading { padding: 3rem 0 1.5rem; }
.page-heading p:last-child { color: var(--text-muted); }
.sermon-list { padding-bottom: 2rem; }
.sermon-card { margin-bottom: 2rem; }
.sermon-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.sermon-card h2 { margin-top: 0; color: var(--parchment); }
.sermon-card time { flex: 0 0 auto; color: var(--aged-gold); font-weight: 700; }
.video-frame { background: #000; border: 1px solid var(--dark-gold); margin: .75rem 0 1.25rem; }
.video-frame video { display: block; width: 100%; aspect-ratio: 16/9; background: #000; }
.sermon-description { color: var(--text-muted); }
.empty-state { text-align: center; margin-bottom: 2rem; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; padding: 0 0 3rem; }
.pagination a, .pagination span { min-width: 2.6rem; padding: .62rem .7rem; text-align: center; border: 1px solid var(--aged-gold); background: var(--stone-dark); color: var(--parchment); text-decoration: none; }
.pagination .current, .pagination a:hover { background: var(--house-red); color: #fff; }
.pagination .ellipsis { border-color: transparent; background: transparent; }

.stream-card { width: min(calc(100% - 2rem), var(--content-wide)); margin: 0 auto 3rem; }
.stream-embed { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden; border: 1px solid var(--aged-gold); }
.stream-embed iframe, .stream-embed video, .stream-embed object, .stream-embed embed { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.stream-offline { min-height: 360px; display: grid; place-content: center; text-align: center; border: 1px dashed var(--aged-gold); padding: 2rem; }
.stream-actions { justify-content: center; }
.site-footer { border-top: 2px solid var(--aged-gold); background: #090603; padding: 2rem 0; text-align: center; color: var(--text-muted); }
.site-footer blockquote { margin: 0 auto 1rem; max-width: 850px; font-family: Georgia, serif; }

/* Administration */
.admin-body { background: #e8dfd1; color: #21160d; color-scheme: light; }
.admin-header { background: var(--stone-black); border-bottom: 3px solid var(--aged-gold); }
.admin-nav-wrap { width: min(calc(100% - 2rem), 1180px); margin: auto; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-brand { color: var(--parchment); text-decoration: none; font-weight: 700; }
.admin-header nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.admin-header nav a { color: var(--parchment); text-decoration: none; padding: .55rem .65rem; }
.admin-header nav a:hover { background: var(--house-red); }
.admin-main { width: min(calc(100% - 2rem), 1180px); margin: 2rem auto; }
.admin-panel { background: #fffaf0; border: 1px solid #c8aa81; border-top: 5px solid var(--house-red); padding: clamp(1rem, 3vw, 2rem); box-shadow: 0 5px 18px rgba(0,0,0,.2); }
.admin-panel h1, .admin-panel h2 { color: var(--house-red); }
.login-panel { max-width: 520px; margin: 4rem auto; }
.admin-form label, .login-panel label { display: grid; gap: .4rem; font-weight: 700; margin-bottom: 1rem; }
.admin-form input[type=text], .admin-form input[type=url], .admin-form input[type=date], .admin-form input[type=datetime-local], .admin-form input[type=file], .admin-form textarea, .login-panel input { width: 100%; background: #fff; color: #21160d; border: 1px solid #a8875f; border-radius: 4px; padding: .7rem; }
.admin-form textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 1rem; }
.checkbox-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: flex-start; }
.checkbox-label input { width: auto; }
.field-help { color: #665747; font-size: .86rem; font-weight: 400; }
.admin-cancel { color: #4b321c; }
.admin-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.dashboard-card { display: flex; flex-direction: column; border: 1px solid #c8aa81; border-left: 5px solid var(--house-red); background: #fff; color: #2a1b10; text-decoration: none; padding: 1rem; }
.dashboard-card strong { color: var(--house-red); font-family: Cinzel, Georgia, serif; font-size: 1.25rem; }
.dashboard-card span { color: #665747; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: .8rem; text-align: left; border-bottom: 1px solid #d8c7ad; }
.admin-table th { background: #efe1cc; color: #42170f; }
.actions { display: flex; align-items: center; gap: .85rem; }
.actions form { margin: 0; }
.link-button { background: none; border: 0; text-decoration: underline; padding: 0; cursor: pointer; color: #4b321c; }
.danger, .danger-button { color: #8a130d; }
.danger-button { background: transparent; border: 1px solid #8a130d; margin-top: 1rem; }
.status { display: inline-block; border-radius: 999px; padding: .2rem .55rem; font-size: .8rem; font-weight: 800; }
.status.published { background: #dcebd9; color: #1d5a20; }
.status.draft { background: #eee0d6; color: #7e321c; }
.flash { max-width: 1180px; margin: 0 auto 1rem; padding: .8rem 1rem; border-radius: 4px; }
.flash-success { background: #dcebd9; color: #1d5a20; border: 1px solid #8eba88; }
.flash-error { background: #f4d9d5; color: #76170f; border: 1px solid #cc8d84; }
.current-video { background: #efe1cc; padding: .7rem; margin-bottom: 1rem; }
.clear-form { margin-top: 1rem; border-top: 1px solid #d8c7ad; padding-top: 1rem; }

@media (max-width: 980px) {
    .action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .action-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--stone-black); border-bottom: 2px solid var(--aged-gold); padding: .5rem 1rem 1rem; }
    .main-nav.open { display: flex; }
    .two-column, .form-grid, .dashboard-grid { grid-template-columns: 1fr; }
    .announcement-card { grid-template-columns: 1fr; }
    .announcement-message.is-scrolling { padding-left: 55%; }
    .sermon-card header { display: block; }
    .sermon-card time { display: block; margin-bottom: .5rem; }
    .admin-nav-wrap { display: block; padding: .8rem 0; }
    .admin-header nav { margin-top: .6rem; }
    .admin-heading-row { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
    .action-grid { grid-template-columns: 1fr; }
    .action-card:last-child { grid-column: auto; }
    .hero img { min-height: 260px; object-position: center; }
    .actions { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
