:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #111111;
    --muted: #666666;
    --line: #e5e5e5;
    --accent: #111111;
    --accent-strong: #111111;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Manrope", Arial, Helvetica, sans-serif;
    font-weight: 400;
    line-height: 1.5;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 30;
    transform: translateY(-160%);
    background: var(--text);
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    border-top: 2px solid #1f3431;
    backdrop-filter: blur(14px);
    transition: transform 180ms ease;
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-height: 74px;
    margin: 0 auto;
    padding: 0 22px 0 0;
}

.header-tools {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-tools--left {
    justify-self: start;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 18px;
    min-width: 0;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 400;
    white-space: nowrap;
}

.auth-links a {
    text-decoration: none;
}

.auth-links span {
    color: var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-self: center;
    gap: 9px;
    color: var(--accent-strong);
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
}

.brand__logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.header-page-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.header-page-nav a {
    text-decoration: none;
}

.header-page-nav a:hover,
.auth-links a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.auth-links__primary {
    text-decoration: none;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    height: 32px;
    border-left: 1px solid var(--line);
    background: transparent;
}

.search-form input {
    width: 0;
    min-width: 0;
    border: 0;
    padding: 0;
    color: var(--text);
    font: inherit;
    background: transparent;
    outline: 0;
    opacity: 0;
    transition: width 180ms ease, opacity 180ms ease, padding 180ms ease;
}

.search-form input::-webkit-search-cancel-button,
.search-form input::-webkit-search-decoration {
    appearance: none;
    display: none;
}

.search-form:focus-within input,
.search-form.is-open input,
.search-form input:not(:placeholder-shown) {
    width: 160px;
    padding: 0 8px 0 0;
    opacity: 1;
}

.search-form button,
.menu-toggle,
.side-menu__close {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.search-form button {
    position: relative;
    display: grid;
    place-items: center;
    width: 52px;
    height: 32px;
    background: transparent;
    color: var(--text);
}

.search-form button i,
.menu-toggle i,
.side-menu__close i {
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
}

.search-form .search-clear {
    width: 32px;
}

.search-form .search-clear[hidden] {
    display: none;
}

.search-form .search-clear i {
    font-size: 1rem;
}

.menu-toggle {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    background: transparent;
    border-radius: 0;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(24, 32, 39, 0.48);
}

.side-menu {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 340px);
    padding: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
}

.side-menu.is-open {
    transform: translateX(0);
}

.side-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    color: var(--accent-strong);
    font-size: 1.15rem;
}

.side-menu__header strong {
    font-weight: 500;
}

.side-menu__close {
    width: 42px;
    height: 42px;
    background: #f5f5f5;
    border-radius: 8px;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1;
}

.side-menu a {
    display: block;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-weight: 400;
    text-decoration: none;
}

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

.member-home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 28px;
    align-items: end;
    padding: 70px 0 34px;
}

.member-home h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 1;
    letter-spacing: 0;
}

.member-home p {
    max-width: 650px;
    color: var(--muted);
    font-size: 1.05rem;
}

.member-status {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.member-status span,
.event-list time {
    color: var(--muted);
    font-size: 0.86rem;
}

.member-status strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    font-weight: 500;
}

.member-status a {
    display: inline-flex;
    margin-top: 12px;
    color: var(--accent-strong);
    font-weight: 500;
    text-decoration: none;
}

.community-section {
    padding: 22px 0 34px;
}

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

.resource-grid article,
.event-list article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.resource-grid article {
    padding: 20px;
}

.resource-grid i {
    font-size: 1.6rem;
}

.resource-grid h3,
.event-list strong {
    display: block;
    margin: 12px 0 6px;
    font-weight: 500;
}

.resource-grid p,
.event-list span {
    color: var(--muted);
}

.event-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.event-list article {
    padding: 18px;
}

.featured-news {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 36px;
    align-items: center;
    min-height: calc(100vh - 72px);
    padding: 54px 0 42px;
}

.featured-news__content h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.25rem, 7vw, 4.9rem);
    line-height: 1;
    letter-spacing: 0;
}

.featured-news__content p {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.08rem;
}

.section-kicker {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
}

.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
}

.featured-news__visual {
    position: relative;
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.featured-news__visual::before {
    position: absolute;
    inset: 34px 28px auto auto;
    width: 54%;
    height: 42%;
    background: #f2f2f2;
    border-radius: 8px;
    content: "";
}

.featured-news__visual::after {
    position: absolute;
    left: 34px;
    bottom: 36px;
    width: 50%;
    height: 44%;
    background: #dcdcdc;
    border-radius: 8px;
    content: "";
}

.featured-news__badge,
.featured-news__panel {
    position: absolute;
    z-index: 1;
}

.featured-news__badge {
    top: 26px;
    left: 26px;
    padding: 7px 12px;
    background: var(--text);
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
}

.featured-news__panel {
    right: 24px;
    bottom: 24px;
    max-width: 260px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.featured-news__panel span {
    color: var(--accent);
    font-weight: 500;
}

.featured-news__panel strong {
    display: block;
    margin-top: 4px;
    font-weight: 500;
}

.featured-news__panel p {
    margin: 8px 0 0;
    color: var(--muted);
}

.news-section {
    padding: 18px 0 72px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    letter-spacing: 0;
}

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

.search-summary {
    margin: -8px 0 20px;
    color: var(--muted);
    font-weight: 400;
}

.news-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.news-card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #f2f2f2;
}

.news-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
}

.news-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 400;
}

.news-card h3 {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.25;
}

.news-card p {
    margin: 0;
    color: var(--muted);
}

.news-card a {
    margin-top: auto;
    color: var(--accent-strong);
    font-weight: 500;
    text-decoration: none;
}

.empty-state {
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.empty-state h3 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0 0 16px;
    color: var(--muted);
}

.empty-state a {
    color: var(--accent-strong);
    font-weight: 500;
    text-decoration: none;
}

.legal-page {
    padding: 54px 0 72px;
}

.legal-hero {
    max-width: 820px;
    padding: 32px 0 26px;
}

.legal-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 6vw, 4rem);
    line-height: 1;
}

.legal-hero p {
    max-width: 680px;
    color: var(--muted);
    font-size: 1.05rem;
}

.legal-document {
    display: grid;
    gap: 22px;
    max-width: 860px;
    min-width: 0;
    padding-bottom: 24px;
}

.legal-document section {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.legal-document h2 {
    margin: 0 0 10px;
    font-size: 1.18rem;
}

.legal-document p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.legal-document p + p {
    margin-top: 10px;
}

.legal-document a {
    color: var(--accent-strong);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.site-footer__inner {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) minmax(180px, 0.8fr) minmax(220px, 1fr);
    align-items: start;
    gap: 24px;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.footer-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.site-footer__brand p {
    margin: 14px 0 0;
}

.site-footer__company {
    display: grid;
    gap: 6px;
    font-style: normal;
}

.site-footer__payments {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.site-footer__payments img {
    display: block;
    width: auto;
    max-width: 62px;
    height: 24px;
    object-fit: contain;
}

.site-footer__company strong,
.site-footer__anpc strong {
    color: var(--text);
}

.site-footer__links,
.site-footer__anpc {
    display: grid;
    gap: 8px;
}

.site-footer a {
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer__anpc a {
    display: block;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
}

.site-footer__anpc .site-footer__anpc-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 0;
    border: 0;
    background: transparent;
}

.site-footer__anpc .site-footer__anpc-logo img {
    display: block;
    width: 100%;
    max-width: 190px;
    height: auto;
    object-fit: contain;
}

.site-footer__credit {
    display: flex;
    justify-content: center;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 24px;
}

.site-footer__credit a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.82rem;
    text-decoration: none;
}

.site-footer__credit img {
    display: block;
    width: auto;
    height: 15px;
    object-fit: contain;
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .site-header {
        backdrop-filter: none;
    }

    .site-header.is-hidden {
        background: transparent;
        border-bottom-color: transparent;
        transform: none;
    }

    .site-header__inner {
        display: flex;
        justify-content: center;
        min-height: 56px;
        padding: 0 12px;
    }

    .header-tools--left {
        position: fixed !important;
        top: auto !important;
        right: 0;
        bottom: 0 !important;
        left: 0;
        z-index: 25;
        display: flex;
        align-items: center;
        justify-content: stretch;
        width: 100%;
        height: 64px;
        padding-bottom: env(safe-area-inset-bottom);
        background: #ffffff;
        transform: none;
        border-top: 1px solid var(--line);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.06);
        transition: transform 180ms ease;
    }

    .site-header.is-hidden .header-tools--left {
        opacity: 1;
        transform: translateY(calc(100% + env(safe-area-inset-bottom)));
    }

    .header-tools--left::after {
        position: absolute;
        top: 14px;
        bottom: 14px;
        left: 50%;
        width: 1px;
        background: var(--line);
        content: "";
    }

    .menu-toggle {
        order: 2;
        flex: 0 0 50%;
        width: 50%;
        height: 64px;
    }

    .search-form {
        order: 1;
        display: flex;
        flex: 0 0 50%;
        justify-content: center;
        width: 50%;
        border-left: 0;
    }

    .search-form:focus-within input,
    .search-form.is-open input,
    .search-form input:not(:placeholder-shown) {
        width: min(32vw, 150px);
    }

    .brand {
        display: none;
    }

    .auth-links {
        gap: 6px;
        font-size: 0.86rem;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .header-page-nav {
        display: none;
    }

    .site-header.is-hidden .auth-links {
        opacity: 0;
        transform: translateY(-100%);
    }

    .side-menu {
        inset: 0 0 0 auto;
        transform: translateX(105%);
    }

    .side-menu.is-open {
        transform: translateX(0);
    }

    .site-footer__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .featured-news {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 34px;
    }

    .member-home,
    .resource-grid,
    .event-list {
        grid-template-columns: 1fr;
    }

    .featured-news__visual {
        min-height: 320px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-main,
    .site-footer__inner {
        width: min(100% - 24px, 1120px);
    }

    .featured-news__content h1 {
        font-size: 2.45rem;
    }

    .featured-news__panel {
        right: 14px;
        bottom: 14px;
        left: 14px;
        max-width: none;
    }

    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
        grid-template-columns: 1fr;
    }
}
