/* Shared front layout: header with menu, footer, CMS page content. Page specific styles stay in the templates. */
:root {
    --site-header-bg: #FAD355;
    --site-header-text: #1E1E1E;
    --site-bg: #f8f9fa;
    --site-text: #3F4254;
    --site-text-muted: #7E8299;
    --site-border: #E4E6EF;
    --site-link: #8A5A00;
    --site-link-hover: #5C3C00;
    --site-max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--site-bg);
    color: var(--site-text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    width: 100%;
    padding: 32px 24px;
}

/* Header */
.site-header {
    background: var(--site-header-bg);
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.site-header-inner {
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    display: block;
    flex-shrink: 0;
    line-height: 0;
}

.site-logo img {
    height: 64px;
    width: auto;
}

.site-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.site-nav-link {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--site-header-text);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s;
}

.site-nav-link:hover {
    background: rgba(255, 255, 255, 0.45);
}

.site-nav-link:focus-visible,
.site-menu-toggle:focus-visible {
    outline: 2px solid var(--site-header-text);
    outline-offset: 2px;
}

.site-nav-link.is-active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.site-menu-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--site-header-text);
    font: inherit;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.site-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.45);
}

.site-menu-toggle-icon {
    position: relative;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: background-color 0.15s;
}

.site-menu-toggle-icon::before,
.site-menu-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s;
}

.site-menu-toggle-icon::before {
    top: -7px;
}

.site-menu-toggle-icon::after {
    top: 7px;
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle-icon {
    background: transparent;
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle-icon::before {
    transform: translateY(7px) rotate(45deg);
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle-icon::after {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 991px) {
    .site-header-inner {
        padding: 10px 16px;
    }

    .site-logo img {
        height: 52px;
    }

    .site-menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--site-header-bg);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 16px 16px;
    }

    .site-nav-link {
        padding: 12px;
        font-size: 17px;
    }
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--site-text-muted);
    font-size: 13px;
}

/* CMS page */
.page-container {
    max-width: 820px;
    margin: 0 auto;
}

.page-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

.page-title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    color: #1E1E1E;
    margin-bottom: 24px;
}

.page-content {
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: break-word;
}

.page-content > * + * {
    margin-top: 16px;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
    color: #1E1E1E;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 32px;
}

.page-content > :first-child {
    margin-top: 0;
}

.page-content h1 { font-size: 28px; }
.page-content h2 { font-size: 24px; }
.page-content h3 { font-size: 20px; }
.page-content h4 { font-size: 17px; }

.page-content a {
    color: var(--site-link);
    font-weight: 500;
    text-decoration: none;
}

.page-content a:hover,
.page-content a:focus-visible {
    color: var(--site-link-hover);
    text-decoration: underline;
}

.page-content ul,
.page-content ol {
    padding-left: 24px;
}

.page-content li + li {
    margin-top: 4px;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
}

.page-content th,
.page-content td {
    border: 1px solid var(--site-border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.page-content th {
    background: #FFFBEB;
    font-weight: 600;
}

.page-content blockquote {
    border-left: 4px solid var(--site-header-bg);
    padding-left: 16px;
    color: var(--site-text-muted);
}

@media (max-width: 640px) {
    .site-main {
        padding: 16px 8px;
    }

    .page-card {
        padding: 24px 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-content table {
        display: block;
        overflow-x: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
