/**
 * School Calendar Landing Page Styles
 * Austin Spanish Academy
 *
 * Class prefix: .sc- (school calendar)
 * Version: 1.0.1
 */

/* =============================================================================
   RESET & BASE STYLES
   ============================================================================= */

/* Hide WordPress-injected empty paragraphs BEFORE the landing page content */
.theme-content > p:first-child,
.theme-content > p:empty,
.theme-content > p:first-child br {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

/* Force body to hide horizontal overflow on SC page to prevent scrollbar gap */
body:has(.sc-landing) {
    overflow-x: hidden !important;
}

.sc-landing {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1A365D;
    line-height: 1.6;
    overflow-x: hidden;
    /* Full-width breakout - 100vw works because body overflow-x is hidden */
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.sc-landing * {
    box-sizing: border-box;
}

.sc-landing section {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* Hide WordPress auto-injected elements */
.sc-landing br,
.sc-landing > p:empty {
    display: none !important;
}

/* =============================================================================
   HERO SECTION
   ============================================================================= */

.sc-hero {
    background: linear-gradient(135deg, #1A365D 0%, #2d4a6f 50%, #3d5a7f 100%) !important;
    color: white;
    min-height: 50vh;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 80px 20px !important;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    width: 100% !important;
}

/* Decorative background circles */
.sc-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(0, 165, 165, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 180, 216, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.sc-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: 1100px;
    width: 100%;
}

.sc-hero-text {
    text-align: left;
    flex: 1;
}

.sc-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem) !important;
    font-weight: 700 !important;
    margin: 0 0 15px 0 !important;
    color: white !important;
    line-height: 1.2 !important;
}

.sc-hero p {
    font-size: 1.25rem;
    margin: 0;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Decorative Hero Image */
.sc-hero-visual {
    flex-shrink: 0;
}

.sc-hero-image {
    width: 280px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: rotate(3deg);
    object-fit: cover;
}

/* =============================================================================
   YEAR TABS
   ============================================================================= */

.sc-year-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.sc-year-tab {
    background: #f5f5f5;
    border: 2px solid #ddd;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A365D;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sc-year-tab:hover {
    background: #e8f4f8;
    border-color: #00A5A5;
}

.sc-year-tab.sc-tab--active {
    background: #00A5A5;
    border-color: #00A5A5;
    color: white;
}

/* =============================================================================
   CALENDAR CONTAINER
   ============================================================================= */

.sc-calendar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================================================
   CALENDAR GRID (12 months)
   ============================================================================= */

.sc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

/* =============================================================================
   INDIVIDUAL MONTH
   ============================================================================= */

.sc-month {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sc-month-header {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1A365D;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #00A5A5;
}

/* =============================================================================
   DAYS HEADER (S M T W T F S)
   ============================================================================= */

.sc-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.sc-days-header span {
    padding: 5px 0;
}

/* =============================================================================
   DAYS GRID
   ============================================================================= */

.sc-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.sc-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.sc-day--empty {
    background: transparent;
}

.sc-day--holiday {
    background: #00A5A5;
    color: white;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.sc-day--holiday:hover {
    background: #008080;
}

/* CSS Tooltip for Safari compatibility (title attribute doesn't work well) */
.sc-day--holiday[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1A365D;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip arrow */
.sc-day--holiday[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1A365D;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.sc-day--holiday[data-tooltip]:hover::after,
.sc-day--holiday[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* =============================================================================
   HOLIDAY LEGEND
   ============================================================================= */

.sc-holiday-legend {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px 30px;
    margin-top: 30px;
}

.sc-holiday-legend h3 {
    font-size: 1.3rem;
    color: #1A365D;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #00A5A5;
}

/* =============================================================================
   HOLIDAY LIST (for both calendar page and School Policy page)
   ============================================================================= */

.sc-holiday-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 40px;
}

.sc-holiday-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    break-inside: avoid;
}

.sc-holiday-list li:last-child {
    border-bottom: none;
}

.sc-holiday-list strong {
    color: #1A365D;
}

.sc-holiday-date {
    color: #666;
    font-size: 0.9rem;
}

/* =============================================================================
   LEGEND KEY
   ============================================================================= */

.sc-legend {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.sc-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #555;
}

.sc-legend-holiday::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #00A5A5;
    border-radius: 4px;
}

/* =============================================================================
   RESPONSIVE: TABLET (768px - 1024px)
   ============================================================================= */

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

    .sc-hero-content {
        gap: 40px;
    }

    .sc-hero-image {
        width: 240px;
    }
}

/* =============================================================================
   RESPONSIVE: MOBILE LANDSCAPE (480px - 768px)
   ============================================================================= */

@media (max-width: 768px) {
    .sc-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .sc-hero {
        padding: 60px 20px !important;
        min-height: auto;
    }

    .sc-hero-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .sc-hero-text {
        text-align: center;
    }

    .sc-hero-visual {
        order: -1;
    }

    .sc-hero-image {
        transform: rotate(0deg);
        width: 220px;
    }

    .sc-hero p {
        font-size: 1rem;
    }

    .sc-holiday-list {
        columns: 1;
    }

    .sc-year-tab {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* =============================================================================
   RESPONSIVE: MOBILE PORTRAIT (<480px)
   ============================================================================= */

@media (max-width: 480px) {
    .sc-calendar-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sc-month {
        max-width: 350px;
        margin: 0 auto;
    }

    .sc-hero {
        padding: 50px 15px !important;
    }

    .sc-hero-image {
        width: 200px;
    }

    .sc-calendar-container {
        padding: 0 10px;
    }

    .sc-year-tabs {
        flex-direction: column;
        align-items: center;
    }

    .sc-year-tab {
        width: 100%;
        max-width: 200px;
    }
}
