/*
 * Ishikari Kouminkan - Main CSS
 * Additional styles for components not in style.css
 */

/* ============================================================
   Skip Link
   ============================================================ */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-navy);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.2s;
    border-radius: 0 0 var(--radius-md) 0;
    font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ============================================================
   WordPress Core Styles
   ============================================================ */
.wp-caption {
    max-width: 100%;
    background: var(--color-sand);
    border-radius: var(--radius-md);
    padding: 8px;
    text-align: center;
}
.wp-caption-text {
    font-size: 0.8125rem;
    color: var(--color-gray-600);
    margin: 6px 0 2px;
}
.alignleft {
    float: left;
    margin: 0 24px 16px 0;
}
.alignright {
    float: right;
    margin: 0 0 16px 24px;
}
.aligncenter {
    display: block;
    margin: 0 auto;
}
.alignwide { margin-left: -48px; margin-right: -48px; }

/* ============================================================
   Screen Reader Text
   ============================================================ */
.screen-reader-text {
    clip: rect(1px,1px,1px,1px);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
.screen-reader-text:focus {
    clip: auto;
    height: auto;
    overflow: visible;
    position: static;
    white-space: normal;
    width: auto;
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .site-header, .site-footer, .hero-slider__nav,
    .hero-slider__arrows, .hamburger, .mobile-nav,
    .btn { display: none !important; }

    body { font-size: 12pt; color: #000; }
    h1, h2, h3 { color: #000; }
    a { color: #000; text-decoration: underline; }
}

/* ============================================================
   High Contrast (Accessibility)
   ============================================================ */
@media (forced-colors: active) {
    .btn, .card, .filter-tab {
        border: 1px solid ButtonText;
    }
}

/* ============================================================
   Focus Styles
   ============================================================ */
:focus-visible {
    outline: 3px solid var(--color-teal);
    outline-offset: 2px;
}
button:focus-visible {
    outline: 3px solid var(--color-teal);
    outline-offset: 2px;
}

/* ============================================================
   Loading Animation
   ============================================================ */
.ik-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ik-spin 0.7s linear infinite;
}
@keyframes ik-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Toast / Alert Messages
   ============================================================ */
.ik-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-navy);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: var(--shadow-xl);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s ease;
}
.ik-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}
.ik-toast--success { background: var(--color-teal); }
.ik-toast--error { background: #e53e3e; }

/* ============================================================
   Form Validation States
   ============================================================ */
.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229,62,62,0.15);
}
.form-input.success,
.form-textarea.success,
.form-select.success {
    border-color: var(--color-teal);
}
.form-error-msg {
    font-size: 0.8125rem;
    color: #e53e3e;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   Back to Top
   ============================================================ */
.back-to-top.visible {
    opacity: 1 !important;
    pointer-events: all !important;
}
.back-to-top:hover {
    background: var(--color-teal) !important;
    transform: translateY(-4px);
}

/* ============================================================
   Sticky Header Scroll State
   ============================================================ */
.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ============================================================
   Hero Slide Entrance Animation
   ============================================================ */
.hero-slide.active .hero-slide__eyebrow {
    animation: fadeInUp 0.6s ease 0.1s both;
}
.hero-slide.active .hero-slide__title {
    animation: fadeInUp 0.6s ease 0.25s both;
}
.hero-slide.active .hero-slide__subtitle {
    animation: fadeInUp 0.6s ease 0.4s both;
}
.hero-slide.active .hero-slide__actions {
    animation: fadeInUp 0.6s ease 0.55s both;
}

/* ============================================================
   Card Hover Effects (Enhanced)
   ============================================================ */
.card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-8px) scale(1.01);
}

/* ============================================================
   Navigation Active State Indicator
   ============================================================ */
.site-nav__item.current-menu-item a::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-teal);
    margin-top: 2px;
    border-radius: 2px;
}

/* ============================================================
   Custom Scrollbar (WebKit)
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-sand); }
::-webkit-scrollbar-thumb {
    background: var(--color-teal);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-navy); }

/* ============================================================
   Selection Color
   ============================================================ */
::selection {
    background: rgba(77,134,133,0.2);
    color: var(--color-navy);
}

/* ============================================================
   Image Lazy Load Placeholder
   ============================================================ */
img[loading="lazy"] {
    transition: opacity 0.4s ease;
}
img[loading="lazy"]:not([src]) {
    opacity: 0;
}

/* ============================================================
   Table Responsive
   ============================================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}
.table-responsive table { min-width: 500px; }

/* ============================================================
   Kouza Category Colors
   ============================================================ */
.card[data-category="文化・芸術"] .card__cat { background: rgba(77,134,133,0.15); color: var(--color-teal); }
.card[data-category="健康・スポーツ"] .card__cat { background: rgba(19,41,70,0.1); color: var(--color-navy); }
.card[data-category="教養・歴史"] .card__cat { background: rgba(239,133,46,0.15); color: var(--color-orange); }
.card[data-category="手芸・料理"] .card__cat { background: rgba(200,100,150,0.15); color: #c86496; }
.card[data-category="音楽・ダンス"] .card__cat { background: rgba(100,150,200,0.15); color: #4a90d9; }

/* ============================================================
   Event Card Hidden State (JS Filter)
   ============================================================ */
.event-card[style*="display: none"],
.card[style*="display: none"] {
    display: none !important;
}

/* ============================================================
   Line Clamp Utilities
   ============================================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   Highlighted Text
   ============================================================ */
mark {
    background: rgba(239,133,46,0.2);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

/* ============================================================
   Inline SVG Icons
   ============================================================ */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    fill: currentColor;
}

/* ============================================================
   Footer Bottom Bar
   ============================================================ */
.footer-bottom .container {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Contact Form Send Button State
   ============================================================ */
#contactSubmit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}
#contactSubmit.sending {
    background: var(--color-gray-400);
}

/* ============================================================
   Search Form (WordPress default)
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-field {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--color-gray-200);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    outline: none;
}
.search-field:focus { border-color: var(--color-teal); }
.search-submit {
    background: var(--color-teal);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.search-submit:hover { background: var(--color-navy); }

/* ============================================================
   Post Navigation
   ============================================================ */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 32px 0;
    border-top: 1px solid var(--color-gray-200);
}
.nav-previous a, .nav-next a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-teal);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-previous a:hover, .nav-next a:hover { color: var(--color-navy); }

/* ============================================================
   Widget Styles
   ============================================================ */
.widget {
    margin-bottom: 32px;
}
.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-sand);
}
.widget ul { list-style: none; }
.widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid var(--color-gray-200);
    font-size: 0.875rem;
}
.widget ul li a { color: var(--color-gray-800); }
.widget ul li a:hover { color: var(--color-teal); }

/* ============================================================
   Announcement Bar (Optional)
   ============================================================ */
.announcement-bar {
    background: var(--color-orange);
    color: white;
    text-align: center;
    padding: 10px var(--container-pad);
    font-size: 0.875rem;
    font-weight: 600;
}
.announcement-bar a {
    color: white;
    text-decoration: underline;
}

/* ============================================================
   Shimmer Loading Effect
   ============================================================ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--color-gray-200) 25%, var(--color-gray-100) 50%, var(--color-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ============================================================
   Responsive Adjustments (cont.)
   ============================================================ */
@media (max-width: 768px) {
    .booking-steps {
        grid-template-columns: 1fr !important;
    }
    .booking-step::after { display: none !important; }

    .page-hero { padding: 48px 0 40px !important; }
    .page-hero__title { font-size: 1.75rem !important; }

    /* shisetsu page — inline grid to 1col on mobile */
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .access-grid,
    .facility-overview,
    .kouza-detail {
        grid-template-columns: 1fr !important;
    }

    .haiku-card .haiku-card__poem {
        font-size: 1.25rem;
    }

    .footer-main__grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .contact-form {
        padding: 24px 16px;
    }
    .contact-form > form > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    .booking-section__grid {
        gap: 12px;
    }
    .hero-slide__title {
        font-size: 1.5rem;
    }
}
