/* ==========================================================================
   DoKHP Website - Responsive Design
   ========================================================================== */

/* Tablet: 768px - 1024px */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .header-top-content {
        flex-wrap: wrap;
    }

    .search-box input {
        width: 150px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

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

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

/* Mobile: 320px - 767px */
@media screen and (max-width: 767px) {
    :root {
        --font-base: 15px;
    }

    .container {
        padding: 0 1rem;
    }

    section {
        padding: 2.5rem 0;
    }

    /* Header */
    .header-top {
        padding: calc(0.75rem * var(--header-scale)) 0;
    }

    .header-top-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .logo {
        flex: 0 0 auto;
        margin-right: 0;
    }

    .logo-icon {
        max-height: calc(58px * var(--header-scale));
    }

    .header-utils {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 0.75rem;
        flex: 1;
    }

    .header-locale {
        display: none;
    }

    .header-actions {
        flex: 1;
        justify-content: flex-end;
        gap: 0.75rem;
    }

    .header-controls {
        gap: 0.35rem;
    }

    .header-search {
        display: none;
    }

    .social-links {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .social-icon {
        width: 28px;
        height: 28px;
    }

    .social-icon svg {
        width: 20px;
        height: 20px;
    }

    /* Mobile Navigation */
    .main-nav .container {
        position: relative;
        padding: 0;
    }

    .mobile-search-toggle {
        display: inline-flex;
    }

    .mobile-menu-toggle {
        display: flex;
        position: static;
        transform: none;
        z-index: auto;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .nav-language-menu {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-lg);
        gap: 0;
        padding: 1rem 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu > li {
        width: 100%;
        flex: none;
    }

    .nav-menu > li > a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        border-left: 3px solid transparent;
        white-space: normal;
        height: auto;
    }

    .nav-item {
        width: 100%;
    }

    .nav-menu > li + li::before {
        display: none;
    }

    .nav-menu > li > a:hover,
    .nav-menu > li > a.active {
        border-bottom-color: var(--border-color);
        border-left-color: var(--primary-color);
        background: var(--bg-gray);
    }

    .nav-item.has-dropdown > .nav-link {
        justify-content: space-between;
        width: 100%;
    }

    .nav-item.has-dropdown > .nav-link::after {
        transform: none;
    }

    .nav-dropdown {
        position: static;
        margin: 0.35rem 1.5rem 0.75rem;
        background: rgba(0, 61, 130, 0.06);
        border-radius: 10px;
        padding: 0.5rem 0.75rem 0.75rem;
        box-shadow: none;
        display: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .nav-item.dropdown-open > .nav-dropdown {
        display: flex;
    }

    .nav-dropdown a {
        border-bottom: none;
        padding: 0.4rem 0;
        font-size: 0.95rem;
    }

    .submenu {
        position: static;
        display: none;
        box-shadow: none;
        border-radius: 0;
        background: var(--bg-gray);
    }

    .has-submenu.open .submenu {
        display: block;
    }

    .has-submenu > a::after {
        content: ' ▼';
        font-size: 0.75em;
        margin-left: 0.5rem;
        transition: var(--transition);
    }

    .has-submenu.open > a::after {
        transform: rotate(180deg);
    }

    /* Hero */
    .hero {
        height: 250px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .hero-arrow {
        width: 40px;
        height: 40px;
    }

    .hero-arrow-prev {
        left: 1rem;
    }

    .hero-arrow-next {
        right: 1rem;
    }

    .hero-arrow svg {
        width: 20px;
        height: 20px;
    }

    .hero-indicators {
        gap: 0.4rem;
        bottom: 1rem;
    }

    .hero-indicator {
        width: 12px;
        height: 12px;
        min-width: 12px;
        min-height: 12px;
        max-width: 12px;
        max-height: 12px;
        flex: 0 0 12px;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Emergency Banner */
    .emergency-content {
        flex-wrap: nowrap;
        text-align: center;
        justify-content: center;
    }

    /* Section Title */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    /* Quick Access */
    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .quick-card {
        padding: 1.5rem 1rem;
    }

    .quick-icon-svg {
        width: 48px;
        height: 48px;
    }

    .quick-card h3 {
        font-size: 0.95rem;
    }

    /* Hot Topics */
    .hot-topics .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .hot-topic-list {
        width: 100%;
        gap: 0.5rem;
    }

    .hot-topic-tag {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
        padding: 0.35rem 0.75rem;
    }

    /* News */
    .news-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
        flex-wrap: wrap;
    }

    .news-section {
        background-size: cover;
        background-position: center;
    }

    .news-columns {
        gap: 1.25rem;
        width: 100%;
    }

    .news-column {
        background: rgba(255, 255, 255, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.35);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        width: 100%;
    }

    .news-list {
        width: 100%;
    }

    .news-category {
        min-width: auto;
        padding: 0.25rem 0.5rem;
    }

    .news-date {
        font-size: 0.8rem;
    }

    .news-category {
        width: fit-content;
    }

    .news-title {
        font-size: 0.9rem;
    }

    /* Statistics */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Banner */
    .banner-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .station-tab {
        flex: 1 1 45%;
        max-width: 48%;
        text-align: center;
    }

    .banner-item img {
        width: 100%;
        height: auto;
    }
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        display: none;
    }

    .footer-section h3 {
        font-size: 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Scroll to Top */
    .scroll-to-top {
        width: 64px;
        height: 64px;
        max-height: none;
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* Small Mobile: 320px - 480px */
@media screen and (max-width: 480px) {
    :root {
        --font-base: 14px;
    }

    .hero {
        height: 300px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .quick-icon {
        font-size: 2rem;
    }

    .stat-icon {
        font-size: 1.75rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }
}

/* Large Desktop: 1440px+ */
@media screen and (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-description {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2.5rem;
    }
}

/* Print Styles */
@media print {
    .header-utils,
    .mobile-menu-toggle,
    .hero-indicators,
    .scroll-to-top {
        display: none !important;
    }

    .header {
        position: static;
    }

    .hero {
        height: 350px;
        padding: 0;
        overflow: hidden;
    }

    .hero-slider {
        position: relative;
        height: 100%;
    }

    .hero-slide {
        position: relative;
        opacity: 0;
        display: none;
        height: 100%;
    }

    .hero-slide.active {
        opacity: 1;
        display: block;
    }

    section {
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }

    /* 印刷時にリンクURLを追記しない */
    a[href]:after {
        content: "";
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Accessibility: High Contrast */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .hero,
    .statistics {
        background: var(--primary-color);
    }

    button,
    a {
        outline: 2px solid transparent;
    }

    button:focus,
    a:focus {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e4e4e4;
        --text-light: #b0b0b0;
        --bg-color: #1a1a1a;
        --bg-gray: #2a2a2a;
        --border-color: #404040;
    }

    body {
        background: var(--bg-color);
        color: var(--text-color);
    }

    .header,
    .main-nav,
    .quick-card,
    .news-card,
    .banner-item {
        background: #2a2a2a;
    }

    .submenu {
        background: #2a2a2a;
    }

    .submenu li a:hover {
        background: #404040;
    }

    .search-box {
        background: #2a2a2a;
    }

    .search-box input {
        background: transparent;
        color: var(--text-color);
    }
}

/* Landscape Orientation */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .hero {
        height: 250px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for touch devices */
    .nav-menu > li > a,
    .submenu li a,
    button,
    .quick-card,
    .news-card {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Remove hover effects on touch devices */
    .quick-card:hover,
    .news-card:hover,
    .stat-card:hover,
    .banner-item:hover {
        transform: none;
    }

    /* Active states for touch */
    .quick-card:active,
    .news-card:active,
    .stat-card:active,
    .banner-item:active {
        opacity: 0.8;
    }
}




