/* ===== 清泉寮 2025年夏イベントサイト CSS ===== */

/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

:root {
    /* Color Palette */
    --primary: #2E8B57;
    --secondary: #87CEEB;
    --accent: #FFD700;
    --danger: #FF6B6B;
    --success: #98FB98;
    --text: #333;
    --text-light: #666;
    --bg: #F8F9FA;
    --white: #FFF;
    
    /* Effects */
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --border-radius: 12px;
    
    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    --font-size-small: 0.8rem;
    --font-size-base: 1rem;
    --font-size-large: 1.25rem;
}

/* ===== BASE STYLES ===== */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

/* Text handling */
p, li, div, span, a {
    overflow-wrap: break-word;
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    transition: var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/* Focus styles */
*:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== LAYOUT COMPONENTS ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--secondary), var(--success));
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition-fast);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.nav a:hover,
.nav a:focus {
    background: var(--white);
    transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero {
    height: 100vh;
    min-height: 600px;
    background: 
        url('images/DSC02wa106_S.png'), 
        linear-gradient(45deg, var(--secondary), var(--success), var(--accent)); 
    background-size: contain, cover;
    background-repeat: no-repeat, no-repeat;
    background-position: center center, center center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    padding: 80px 1rem 1rem;
}

.hero h1 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    margin-bottom: 1rem;
    animation: slideInUp 1s ease-out;
}

.hero p {
    font-size: clamp(0.9rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    animation: slideInUp 1s ease-out 0.3s both;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--danger);
    color: var(--white);
    animation: slideInUp 1s ease-out 0.6s both;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #FF5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}

/* ===== BADGE ===== */
.badge {
    position: fixed;
    top: 120px;
    right: 20px;
    background: var(--accent);
    color: var(--primary);
    padding: 1rem;
    border-radius: 50%;
    font-weight: bold;
    text-align: center;
    box-shadow: var(--shadow);
    z-index: 999;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    font-size: var(--font-size-small);
    text-decoration: none;
    transition: var(--transition-fast);
}

.badge:hover {
    transform: scale(1.1);
    animation-play-state: paused;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== SECTIONS ===== */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 3rem;
    color: var(--primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* ===== QUICK INFO ===== */
.quick-info {
    background: var(--white);
    padding: 2rem;
    margin: 2rem auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
    width: 100%;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.info-item {
    text-align: center;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.info-value {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== FILTER SYSTEM ===== */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.3);
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

.filter-count {
    margin-left: 0.5rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    font-size: var(--font-size-small);
    animation: countUp 0.3s ease;
}

@keyframes countUp {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== RESULTS COUNTER ===== */
.results-counter {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-light);
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition-fast);
}

.results-counter.visible {
    opacity: 1;
    transform: translateY(0);
}

.results-counter .count {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.3rem;
    transition: var(--transition-fast);
}

/* ===== EVENTS GRID ===== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    min-height: 400px;
}

/* ===== EVENT CARDS ===== */
.event-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition-medium);
    width: 100%;
    transform-origin: center;
    position: relative;
}

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

/* Filter Animation States */
.event-card.filtering-out {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.event-card.filtering-in {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.event-card.hidden {
    display: none;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== EVENT CARD COMPONENTS ===== */
.event-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, var(--secondary), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    overflow: hidden;
    position: relative;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-fast);
}

.event-image:hover img {
    transform: scale(1.05);
}

.fallback-icon {
    font-size: 3rem;
    opacity: 0.7;
}

.event-content {
    padding: 1.5rem;
}

.genre-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: var(--font-size-small);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.genre-tag.nature {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
}

.genre-tag.water {
    background: linear-gradient(135deg, #2196F3, #42A5F5);
    color: white;
}

.genre-tag.gourmet {
    background: linear-gradient(135deg, #FF9800, #FFB74D);
    color: white;
}

.genre-tag.culture {
    background: linear-gradient(135deg, #9C27B0, #BA68C8);
    color: white;
}

.event-title {
    font-size: var(--font-size-large);
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 600;
    line-height: 1.4;
}

.event-date {
    background: var(--danger);
    color: var(--white);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.event-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.event-highlights {
    list-style: none;
    margin-bottom: 1.5rem;
}

.event-highlights li {
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-light);
}

.event-highlights li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.event-location {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

/* ===== STAMP RALLY ===== */
.stamp-rally {
    background: linear-gradient(135deg, var(--success), var(--secondary));
    padding: 4rem 1rem;
    text-align: center;
    color: var(--white);
}

.stamp-rally h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stamp-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stamp-icon {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition-fast);
    flex-shrink: 0;
    cursor: pointer;
}

.stamp-icon:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ===== FAQ ===== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    transition: var(--transition-fast);
}

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

.faq-item summary {
    padding: 1rem;
    background: var(--bg);
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition-fast);
    position: relative;
}

.faq-item summary:hover {
    background: #f0f0f0;
}

.faq-item summary::marker {
    color: var(--primary);
}

.faq-item div {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.footer h3 {
    margin-bottom: 1rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    flex-wrap: wrap;
    transition: var(--transition-fast);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.contact-item a {
    color: inherit;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 1000;
    font-size: 1.2rem;
    font-weight: bold;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
    background: #1a5f3f;
    box-shadow: 0 4px 15px rgba(46, 139, 87, 0.4);
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0;
    }

    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav {
        gap: 0.5rem;
        justify-content: center;
    }

    .hero {
        height: 100vh;
        min-height: 500px;
        padding: 120px 1rem 1rem;
        background-size: 80% auto, cover;
    }

    .section {
        padding: 2rem 0;
    }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .badge {
        width: 70px;
        height: 70px;
        top: 100px;
        right: 15px;
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .contact-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stamp-icons {
        gap: 1rem;
    }

    .stamp-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .quick-info {
        margin: 1rem auto;
        padding: 1rem;
    }

    .filter-container {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 100vh;
        min-height: 450px;
        padding: 110px 0.5rem 0.5rem;
        background-size: 75% auto, cover;
    }

    .hero h1 {
        font-size: clamp(1.2rem, 6vw, 2rem);
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: clamp(0.8rem, 4vw, 1.2rem);
        margin-bottom: 1.5rem;
    }

    .badge {
        width: 60px;
        height: 60px;
        top: 90px;
        right: 10px;
        font-size: 0.65rem;
        padding: 0.3rem;
    }

    .stamp-rally {
        padding: 2rem 0.5rem;
    }

    .footer {
        padding: 2rem 0;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .header {
        padding: 0.3rem 0;
    }

    .header-content {
        gap: 0.3rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .nav a {
        padding: 0.3rem 0.5rem;
        font-size: 0.9rem;
    }

    .filter-container {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .filter-btn {
        min-width: 200px;
    }
}

@media (max-width: 360px) {
    .hero {
        min-height: 400px;
        padding: 100px 0.3rem 0.3rem;
        background-size: 70% auto, cover;
    }

    .badge {
        width: 50px;
        height: 50px;
        top: 85px;
        right: 8px;
        font-size: 0.6rem;
        padding: 0.2rem;
    }

    .hero h1 {
        font-size: clamp(1rem, 7vw, 1.8rem);
    }

    .hero p {
        font-size: clamp(0.7rem, 5vw, 1rem);
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0 0.25rem;
    }

    .events-grid {
        gap: 0.5rem;
    }

    .event-content {
        padding: 1rem;
    }

    .badge {
        width: 45px;
        height: 45px;
        font-size: 0.55rem;
        right: 5px;
        top: 80px;
    }

    .hero {
        min-height: 380px;
        padding: 95px 0.2rem 0.2rem;
        background-size: 65% auto, cover;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    
    .badge {
        animation: none;
    }
    
    .hero h1, .hero p, .btn-primary {
        animation: none;
    }
}

@media (prefers-color-scheme: dark) {
    /* Dark mode support can be added here if needed */
}

/* ===== PRINT STYLES ===== */
@media print {
    .header, .badge, .back-to-top {
        display: none;
    }
    
    .hero {
        height: auto;
        min-height: auto;
        padding: 2rem 1rem;
        background: none;
        color: var(--text);
        text-shadow: none;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    .event-card {
        break-inside: avoid;
    }
}