/*
Theme Name: Toyama Log
Theme URI:
Author: toyama log
Author URI:
Description: 富山県全域のローカル情報サイト「toyama log」専用テーマ
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toyama-log
Tags: custom-post-types, responsive, local-media
*/

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* Base — PostHog inspired warm parchment */
    --color-bg: #F8F7F3;
    --color-bg-alt: #FFFFFF;
    --color-bg-card: #FFFFFF;

    /* Primary - 立山ネイビー */
    --color-primary: #1B3A5C;
    --color-primary-light: #2A5580;
    --color-primary-dark: #0F2440;

    /* Text — Airbnb inspired warm near-black */
    --color-text: #262626;
    --color-text-light: #555555;
    --color-text-muted: #8A8A8A;

    /* Accent - くすんだ青緑 */
    --color-accent: #3D7A7A;
    --color-accent-light: #5A9E9E;

    /* Warm accent - 銅色 */
    --color-warm: #B87333;
    --color-warm-light: #D4956A;

    /* Highlight accent - 補助色 */
    --color-highlight: #E8734A;
    --color-highlight-light: #F09070;

    /* Status */
    --color-new: #1A8C6E;
    --color-closed: #C0392B;
    --color-moved: #7C5CBF;
    --color-renewal: #D4A017;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Typography — Pinterest CJK fallback stack */
    --font-sans: "Noto Sans JP", -apple-system, system-ui, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    --font-logo: "Inter", "Noto Sans JP", -apple-system, system-ui, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.375rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2.25rem;

    /* Border Radius — Airbnb scale: subtle/standard/badge/card/large */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadow — Airbnb three-layer system */
    --shadow-sm: rgba(0,0,0,0.02) 0 0 0 1px, rgba(0,0,0,0.04) 0 2px 4px;
    --shadow-md: rgba(0,0,0,0.02) 0 0 0 1px, rgba(0,0,0,0.04) 0 2px 6px, rgba(0,0,0,0.08) 0 4px 12px;
    --shadow-lg: rgba(0,0,0,0.02) 0 0 0 1px, rgba(0,0,0,0.05) 0 4px 10px, rgba(0,0,0,0.10) 0 8px 24px;

    /* Border — PostHog sage-tinted */
    --color-border: rgba(27, 58, 50, 0.08);
    --color-border-hover: rgba(27, 58, 50, 0.15);

    /* Layout */
    --container-max: 1200px;
    --header-height: 56px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent);
}

ul, ol {
    list-style: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-3xl) 0;
}

.section__title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-xl);
    position: relative;
    padding-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.section__title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 80 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,6 L12,3 L24,5 L36,1 L48,4 L60,2 L72,5 L80,3' fill='none' stroke='%233D7A7A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
    background-size: contain;
}

.section__more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: 600;
    margin-top: var(--space-lg);
    padding: var(--space-sm) var(--space-lg);
    border: 1.5px solid var(--color-primary);
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.section__more:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background: var(--color-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.site-logo {
    font-family: var(--font-logo);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
}

.site-logo:hover {
    color: #fff;
    opacity: 0.9;
}

.site-logo span {
    font-weight: 300;
    opacity: 0.65;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.site-nav__link {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-base);
    font-weight: 500;
    padding: var(--space-xs) 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav__link:hover,
.site-nav__link--active {
    color: #fff;
    border-bottom-color: var(--color-warm);
}

.header-search {
    position: relative;
}

.header-search__input {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    color: #fff;
    padding: 7px var(--space-lg);
    padding-right: 2.5rem;
    font-size: var(--font-size-sm);
    width: 260px;
    transition: background 0.2s, border-color 0.2s;
}

.header-search__input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.header-search__input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-search__btn {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: var(--space-xs);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: var(--space-xs);
}

.menu-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: transform 0.3s;
}

/* ==========================================================================
   Section Dividers (A: 富山モチーフ)
   ========================================================================== */

.divider {
    line-height: 0;
    margin: 0;
    overflow: hidden;
}

.divider svg {
    display: block;
    width: 100%;
    height: 28px;
}

.divider--ridge {
    background: var(--color-bg);
}

.divider--wave {
    background: var(--color-bg-alt);
}

.divider--ridge-inv {
    background: var(--color-bg);
}

.divider--wave-inv {
    background: var(--color-bg-alt);
}

/* ==========================================================================
   Toyama Bay Wave (ヘッダー直下)
   ========================================================================== */

.bay-wave {
    display: none;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    z-index: 2;
    margin-bottom: -80px;
    background: linear-gradient(180deg, #D0DAF0 0%, #E4C4D6 50%, var(--color-bg) 100%);
}

.hero__bg {
    display: block;
    line-height: 0;
}

.hero__bg img {
    display: block;
    width: 100%;
    height: auto;
}

.hero__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: var(--space-lg) 0;
}

.hero__title {
    font-family: var(--font-logo);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 12px rgba(15, 30, 60, 0.5), 0 1px 3px rgba(15, 30, 60, 0.3);
}

.hero__title span {
    font-weight: 300;
}

/* ==========================================================================
   Status Labels
   ========================================================================== */

.status-label {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.status-label--new {
    background: #D4EDDA;
    color: var(--color-new);
}

.status-label--opened {
    background: #D4EDDA;
    color: var(--color-new);
}

.status-label--closing {
    background: #FADBD8;
    color: var(--color-closed);
}

.status-label--closed {
    background: #FADBD8;
    color: var(--color-closed);
}

.status-label--moved {
    background: #E8DAEF;
    color: var(--color-moved);
}

.status-label--renewal {
    background: #FEF5D4;
    color: var(--color-renewal);
}

/* ==========================================================================
   Weekly Highlights
   ========================================================================== */

.weekly-highlights {
    /* container removed - cards stand alone in grid */
}

.weekly-highlights__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.weekly-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--color-bg-card);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.weekly-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.weekly-item__status {
    flex-shrink: 0;
}

.weekly-item__body {
    flex: 1;
    min-width: 0;
}

.weekly-item__title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    display: block;
    line-height: 1.55;
    letter-spacing: -0.01em;
}

.weekly-item__title:hover {
    color: var(--color-primary);
}

.weekly-item__meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 2px;
}

.weekly-item__meta span + span::before {
    content: " / ";
}

.weekly-item__date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   Card Grid - 開店・閉店カード
   ========================================================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
}

/* Airbnb-inspired warm card with three-layer shadow */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: none;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.card__image {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #E8EDF2 0%, #D5DDE6 100%);
    position: relative;
    overflow: hidden;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card__image--placeholder::after {
    content: "";
    width: 48px;
    height: 48px;
    border: 2px solid rgba(27, 58, 92, 0.1);
    border-radius: 50%;
}

.card__status {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
}

.card__body {
    padding: var(--space-sm) var(--space-md);
}

.card__title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.55;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.card__title a {
    color: inherit;
}

.card__title a:hover {
    color: var(--color-primary);
}

.card__meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ==========================================================================
   Area Cards - 市町村カード
   ========================================================================== */

.area-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
}

.area-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,247,244,0.9));
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
    min-height: 140px;
}

/* Rainbow gradient border */
.area-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1.5px;
    background: linear-gradient(135deg, #E91E63, #FF9800, #4CAF50, #2196F3, #9C27B0, #E91E63);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.area-card:hover::before {
    opacity: 0.7;
}

.area-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    color: var(--color-text);
}

/* Illustration positioned at top-right */
.area-card__illust {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 56px;
    height: 56px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.area-card__illust svg {
    width: 100%;
    height: 100%;
}

.area-card:hover .area-card__illust {
    opacity: 0.75;
}

/* Background pattern (kept for non-illustrated cards) */
.area-card__bg {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: var(--area-pattern, none);
    background-repeat: repeat;
    background-position: right top;
    background-size: 100px;
    pointer-events: none;
    mask-image: linear-gradient(to left, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 60%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 60%);
}

.area-card__name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-primary);
    position: relative;
    z-index: 1;
    margin-bottom: var(--space-xs);
}

.area-card__copy {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Event List
   ========================================================================== */

.event-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.event-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease;
}

.event-item:hover {
    box-shadow: var(--shadow-md);
}

.event-item__date-badge {
    flex-shrink: 0;
    width: 46px;
    text-align: center;
    padding: 6px 0;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: #fff;
    line-height: 1.2;
}

.event-item__date-badge-month {
    display: block;
    font-size: 9px;
    font-weight: 600;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-item__date-badge-day {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.event-item__image {
    flex-shrink: 0;
    width: 100px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #E8EDF2 0%, #D5DDE6 100%);
    overflow: hidden;
}

.event-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-item__body {
    flex: 1;
    min-width: 0;
}

.event-item__title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.event-item__title a {
    color: inherit;
}

.event-item__title a:hover {
    color: var(--color-primary);
}

.event-item__meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   Life Info List
   ========================================================================== */

.life-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.life-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.life-item:hover {
    background: rgba(27, 58, 50, 0.02);
}

.life-item:last-child {
    border-bottom: none;
}

.life-item__date {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    width: 4em;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.life-item__area {
    flex-shrink: 0;
    font-size: 11px;
    color: #fff;
    font-weight: 600;
    background: var(--color-accent);
    padding: 1px 8px;
    border-radius: 10px;
    min-width: 4em;
    text-align: center;
}

.life-item__title {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.life-item__title a {
    color: inherit;
}

.life-item__title a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   Bottom Two-Column (Events + Life side by side)
   ========================================================================== */

.bottom-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

.bottom-two-col .section {
    padding: 0;
}

.bottom-two-col .section__title {
    font-size: var(--font-size-xl);
}

/* ==========================================================================
   Footer Sparkle
   ========================================================================== */

.site-footer {
    position: relative;
}

.footer-sparkle {
    position: absolute;
    top: -30px;
    right: 40px;
    pointer-events: none;
    opacity: 0.15;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
}

.site-footer__brand {
    font-family: var(--font-logo);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-sm);
}

.site-footer__desc {
    font-size: var(--font-size-sm);
    line-height: 1.7;
    opacity: 0.7;
}

.site-footer__heading {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #fff;
    margin-bottom: var(--space-md);
}

.site-footer__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.site-footer__links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
    transition: color 0.2s;
}

.site-footer__links a:hover {
    color: #fff;
}

.site-footer__bottom {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-size-xs);
    opacity: 0.5;
    text-align: center;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */

.breadcrumb {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding: var(--space-md) 0;
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb__sep {
    margin: 0 var(--space-xs);
    opacity: 0.5;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-2xl);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: background 0.2s, color 0.2s;
}

.pagination a {
    color: var(--color-text-light);
}

.pagination a:hover {
    background: var(--color-primary);
    color: #fff;
}

.pagination .current {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .area-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .weekly-highlights__list {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottom-two-col {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .site-nav {
        display: none;
    }

    .site-nav--open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-primary);
        padding: var(--space-lg);
        gap: var(--space-md);
        box-shadow: var(--shadow-lg);
    }

    .menu-toggle {
        display: block;
    }

    .header-search {
        display: none;
    }

    .hero {
        margin-bottom: -40px;
    }

    .hero__content {
        padding: var(--space-md) 0;
    }

    .hero__categories {
        flex-wrap: wrap;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .area-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .weekly-highlights__list {
        grid-template-columns: 1fr;
    }

    .event-item {
        flex-direction: column;
    }

    .event-item__image {
        width: 100%;
        height: 140px;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    .section__title {
        font-size: var(--font-size-xl);
    }
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.page-404 {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.page-404__content {
    max-width: 520px;
    margin: 0 auto;
}

.page-404__code {
    font-family: var(--font-logo);
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-primary);
    opacity: 0.12;
    line-height: 1;
    margin-bottom: var(--space-md);
}

.page-404__title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.page-404__desc {
    color: var(--color-text-light);
    margin-bottom: var(--space-2xl);
}

.page-404__search {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
}

.page-404__search-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid rgba(27, 58, 92, 0.15);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-sans);
    background: var(--color-bg-alt);
    color: var(--color-text);
    transition: border-color 0.2s;
}

.page-404__search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.page-404__search-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.2s;
}

.page-404__search-btn:hover {
    background: var(--color-primary-light);
}

.page-404__nav-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.page-404__links {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.page-404__links a {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-bg-alt);
    border: 1px solid rgba(27, 58, 92, 0.08);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    transition: background 0.2s, box-shadow 0.2s;
}

.page-404__links a:hover {
    box-shadow: var(--shadow-sm);
    background: #fff;
}

/* E: 404 雪アニメーション + 稜線装飾 */
.page-404-wrap {
    position: relative;
    overflow: hidden;
    min-height: 70vh;
}

.page-404__ridge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    line-height: 0;
    pointer-events: none;
}

.snow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.snow__particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: snowfall linear infinite;
}

.snow__particle:nth-child(1)  { left: 5%;  animation-duration: 12s; animation-delay: 0s;    width: 3px; height: 3px; }
.snow__particle:nth-child(2)  { left: 15%; animation-duration: 15s; animation-delay: 2s;    width: 4px; height: 4px; }
.snow__particle:nth-child(3)  { left: 25%; animation-duration: 10s; animation-delay: 4s;    width: 2px; height: 2px; }
.snow__particle:nth-child(4)  { left: 35%; animation-duration: 14s; animation-delay: 1s;    width: 3px; height: 3px; }
.snow__particle:nth-child(5)  { left: 45%; animation-duration: 11s; animation-delay: 3s;    width: 5px; height: 5px; }
.snow__particle:nth-child(6)  { left: 55%; animation-duration: 16s; animation-delay: 5s;    width: 2px; height: 2px; }
.snow__particle:nth-child(7)  { left: 65%; animation-duration: 13s; animation-delay: 0.5s;  width: 4px; height: 4px; }
.snow__particle:nth-child(8)  { left: 75%; animation-duration: 10s; animation-delay: 3.5s;  width: 3px; height: 3px; }
.snow__particle:nth-child(9)  { left: 82%; animation-duration: 14s; animation-delay: 1.5s;  width: 2px; height: 2px; }
.snow__particle:nth-child(10) { left: 90%; animation-duration: 12s; animation-delay: 4.5s;  width: 4px; height: 4px; }
.snow__particle:nth-child(11) { left: 10%; animation-duration: 17s; animation-delay: 6s;    width: 3px; height: 3px; }
.snow__particle:nth-child(12) { left: 50%; animation-duration: 13s; animation-delay: 7s;    width: 2px; height: 2px; }

@keyframes snowfall {
    0% {
        transform: translateY(-10px) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.06;
    }
    50% {
        opacity: 0.04;
    }
    90% {
        opacity: 0.02;
    }
    100% {
        transform: translateY(calc(70vh + 10px)) translateX(30px);
        opacity: 0;
    }
}

/* ==========================================================================
   Search Filters
   ========================================================================== */

.search-filters {
    background: var(--color-bg-alt);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-md);
}

.search-filters__row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.search-filters__label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: var(--space-xs);
}

.search-filters__input,
.search-filters__select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid rgba(27, 58, 92, 0.15);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: var(--font-sans);
    color: var(--color-text);
    background: #fff;
    transition: border-color 0.2s;
    appearance: none;
}

.search-filters__select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235A6B7D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

.search-filters__input:focus,
.search-filters__select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-filters__actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.search-filters__btn {
    padding: var(--space-sm) var(--space-xl);
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.2s;
}

.search-filters__btn:hover {
    background: var(--color-primary-light);
}

.search-filters__reset {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.search-filters__reset:hover {
    color: var(--color-primary);
}

.search-results__count {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
}

.search-no-results {
    text-align: center;
    padding: var(--space-3xl) 0;
    color: var(--color-text-light);
}

.search-no-results p + p {
    margin-top: var(--space-sm);
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .search-filters__row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .search-filters__row {
        grid-template-columns: 1fr;
    }

    .page-404__code {
        font-size: 4rem;
    }

    .page-404__search {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .area-grid {
        grid-template-columns: 1fr;
    }

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