:root {
    --ink: #17212a;
    --muted: #5d6872;
    --line: #d8e1e7;
    --paper: rgba(255, 255, 255, 0.94);
    --soft: #f4f7f8;
    --accent: #2f6f73;
    --dark: #1f3034;
    --blue: #d8e8ff;
    --red: #ffe0df;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Yu Gothic", "Hiragino Sans", "Meiryo", Arial, sans-serif;
    color: var(--ink);
    background: var(--soft);
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    width: min(1120px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    gap: 10px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

.nav {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
    padding: 9px 12px;
    border-radius: 6px;
}

.nav a.active,
.nav a:hover {
    background: #e7f1f2;
    color: var(--accent);
}

.hero {
    background: var(--dark);
    color: #fff;
}

.hero-inner,
.section {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.hero-inner {
    min-height: 420px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
    align-items: center;
    gap: 32px;
    padding: 42px 0;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.1;
}

.hero p,
.lead {
    color: var(--muted);
    line-height: 1.8;
    font-size: 17px;
}

.hero p {
    color: #dce7e8;
}

.section {
    padding: 36px 0;
}

.section-title {
    margin: 0 0 18px;
    font-size: 30px;
}

.video-frame,
.media-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000;
}

.actions,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.button,
.toolbar button,
.admin-panel button {
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: 10px 14px;
    text-decoration: none;
}

.button.secondary,
.admin-inline-form button {
    background: #263840;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.home-menu-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.panel,
.today-bible,
.church-info,
.admin-panel,
.empty-box {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.card h3 {
    margin: 0 0 10px;
}

.menu-card {
    align-items: flex-end;
    aspect-ratio: 4 / 3;
    background-color: #1f3034;
    background-image: linear-gradient(180deg, rgba(23, 33, 42, 0.16), rgba(23, 33, 42, 0.72)), var(--menu-image);
    background-position: center;
    background-size: cover;
    color: #fff;
    display: flex;
    min-height: 150px;
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.menu-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.menu-card h3 {
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.menu-card-sermons {
    --menu-image: url("menu-sermons.png");
}

.menu-card-bible {
    --menu-image: url("menu-bible.png");
}

.menu-card-praise {
    --menu-image: url("menu-praise.png");
}

.menu-card-about {
    --menu-image: url("menu-about.png");
}

.card p,
.church-info p {
    line-height: 1.7;
}

.info-list {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 12px 18px;
}

.info-list dt {
    font-weight: 800;
}

.info-list dd {
    margin: 0;
    color: var(--muted);
}

.map-box {
    margin-top: 18px;
}

.map-route + .map-route {
    margin-top: 18px;
}

.map-route h3 {
    margin: 0 0 10px;
}

.map-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
}

.route-box {
    background: #f4f7f8;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.route-box h3 {
    margin: 0 0 8px;
}

.route-box p {
    color: var(--muted);
    line-height: 1.75;
    margin: 0;
}

.map-link {
    display: inline-block;
    margin-top: 12px;
}

.logo-meaning {
    align-items: center;
    display: grid;
    gap: 20px;
    grid-template-columns: 72px minmax(0, 1fr);
}

.logo-meaning-image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    display: block;
    object-fit: cover;
}

.logo-meaning h2 {
    margin: 0 0 8px;
}

.logo-meaning p {
    color: var(--muted);
    line-height: 1.8;
    margin: 0;
}

.access-guide {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 16px;
}

.access-guide h3 {
    margin: 0 0 8px;
}

.access-guide p {
    color: var(--muted);
    line-height: 1.75;
    margin: 0;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.reading-link {
    display: block;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 800;
    padding: 12px;
    text-align: center;
    text-decoration: none;
}

.reading-link.blue {
    background: var(--blue);
}

.reading-link.red {
    background: var(--red);
}

.today-bible {
    margin-top: 20px;
}

.today-bible h2 {
    text-align: center;
}

.today-bible-text {
    white-space: pre-wrap;
    text-align: left;
    line-height: 1.8;
    font-size: 1.1em;
}

.toolbar {
    justify-content: center;
    margin: 8px 0 16px;
}

.toolbar button.rate-button {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.toolbar button.rate-button.active {
    background: var(--blue);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.video-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    overflow: hidden;
    text-decoration: none;
}

.card-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: 0;
    background: #000;
}

.video-card h3 {
    margin: 0;
    padding: 12px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.45;
}

.video-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(47, 111, 115, 0.18);
}

.playlist-link-card {
    align-items: center;
    background: #263840;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 210px;
    text-align: center;
}

.playlist-link-card h3 {
    padding: 10px 14px 0;
}

.playlist-link-mark {
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    display: inline-flex;
    font-size: 24px;
    height: 58px;
    justify-content: center;
    padding-left: 4px;
    width: 58px;
}

.featured-video {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    width: min(640px, 100%);
    margin: 0 auto 18px;
    overflow: hidden;
}

.featured-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: 0;
    background: #000;
}

.featured-video-copy {
    padding: 18px 20px 20px;
}

.featured-video-copy h2 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.45;
}

.video-description {
    color: var(--muted);
    line-height: 1.75;
    margin: 0;
    max-height: 8.75em;
    overflow: auto;
    white-space: pre-wrap;
}

.list-title {
    font-size: 22px;
    margin: 22px 0 12px;
}

.video-list-grid {
    margin-top: 16px;
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    background: #000;
}

.video-thumb-empty {
    background: #1f3034;
}

.church-info {
    width: min(900px, calc(100% - 32px));
    margin: 24px auto;
    text-align: center;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 22px;
    text-align: center;
}

.admin-panel {
    width: min(900px, calc(100% - 32px));
    margin: 28px auto;
}

.admin-form {
    display: grid;
    gap: 12px;
}

.admin-form label {
    font-weight: 800;
}

.admin-form input,
.admin-form textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    padding: 10px;
    width: 100%;
}

.admin-form textarea {
    min-height: 180px;
    resize: vertical;
}

.admin-date-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
}

.admin-date-row span {
    color: var(--muted);
    font-weight: 800;
}

.admin-actions,
.admin-inline-form {
    margin-top: 10px;
}

.success-msg,
.error-msg {
    border-radius: 6px;
    font-weight: 800;
    margin: 8px 0;
    padding: 10px 12px;
}

.success-msg {
    background: #e5f6e9;
    color: #1f6a34;
}

.error-msg {
    background: #ffe5e3;
    color: #b21f16;
}

.login-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.62);
}

.modal-box {
    width: min(420px, calc(100% - 32px));
    margin: 12vh auto;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
}

.modal-box input {
    width: 100%;
    padding: 10px;
    margin: 8px 0 12px;
}

.modal-box button {
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    margin-right: 6px;
    padding: 10px 14px;
}

@media (max-width: 820px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
    }

    .hero-inner,
    .grid,
    .home-menu-grid,
    .video-grid,
    .link-grid {
        grid-template-columns: 1fr;
    }

    .hero-inner {
        min-height: auto;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .admin-date-row {
        grid-template-columns: 1fr;
    }

    .logo-meaning {
        grid-template-columns: 1fr;
    }
}
