/* ==========================================================================
   Public Site Polish — Enhanced Version
   Load after the main guest stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base Improvements
   -------------------------------------------------------------------------- */
:root {
    --section-gap: clamp(64px, 8vw, 120px);
    --content-max: 1200px;
    --card-radius: 16px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-content {
    max-width: 680px;
    padding-right: 24px;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 24px rgba(11, 59, 77, 0.4);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.6;
    max-width: 540px;
    opacity: 0.92;
    text-shadow: 0 1px 12px rgba(11, 59, 77, 0.3);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.hero-buttons.visible {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Section Rhythm & Spacing
   -------------------------------------------------------------------------- */
.features-section,
.programs-section,
.teachers-section {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
    position: relative;
}

.features-section {
    background: var(--white, #fff);
}

.programs-section {
    background: linear-gradient(180deg, #f8fafb 0%, #f4f6f7 100%);
}

.teachers-section {
    background: #faf6ee;
    position: relative;
}

.teachers-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 134, 59, 0.3), transparent);
}

.cta-section {
    padding: clamp(72px, 10vw, 120px) 24px;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 175, 106, 0.08), transparent 70%);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Section Headers — Editorial Style
   -------------------------------------------------------------------------- */
.section-header {
    margin-bottom: clamp(36px, 5vw, 56px);
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin-bottom: 14px;
    color: var(--ink, #10222c);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 2px;
    background: var(--brass, #b8863b);
    margin: 16px auto 0;
    border-radius: 2px;
}

.section-header p {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink-soft, #55677a);
}

/* --------------------------------------------------------------------------
   Features — Refined Cards
   -------------------------------------------------------------------------- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
}

.feature {
    padding: 32px 28px;
    border-radius: var(--card-radius);
    background: var(--white, #fff);
    border: 1px solid var(--gray-200, #e9ecee);
    border-top: 3px solid var(--bahari, #1c6e8c);
    transition: transform 0.3s var(--ease-out),
                box-shadow 0.3s var(--ease-out),
                border-color 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bahari), var(--bahari-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(16, 34, 44, 0.1);
    border-color: var(--bahari-light, #4a93ac);
}

.feature:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(28, 110, 140, 0.08);
    color: var(--bahari, #1c6e8c);
    margin-bottom: 20px;
    transition: background 0.3s var(--ease-out),
                color 0.3s var(--ease-out),
                transform 0.3s var(--ease-out);
}

.feature:hover .feature-icon {
    background: var(--bahari, #1c6e8c);
    color: var(--white, #fff);
    transform: scale(1.05);
}

.feature h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink, #10222c);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.feature p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-soft, #55677a);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Programs — Elevated Cards
   -------------------------------------------------------------------------- */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
}

.program-card {
    border-radius: var(--card-radius);
    background: var(--white, #fff);
    border: 1px solid var(--gray-200, #e9ecee);
    overflow: hidden;
    transition: transform 0.35s var(--ease-out),
                box-shadow 0.35s var(--ease-out);
    display: flex;
    flex-direction: column;
    position: relative;
}

.program-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(16, 34, 44, 0.12);
}

.program-icon {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--bahari-deep, #0b3b4d), var(--bahari, #1c6e8c));
    color: var(--brass-light, #d4af6a);
    position: relative;
    overflow: hidden;
}

.program-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), transparent 60%);
}

.program-content {
    padding: 28px 26px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.program-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink, #10222c);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.program-age {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brass, #b8863b);
    background: rgba(184, 134, 59, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 14px;
    align-self: flex-start;
}

.program-description {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--ink-soft, #55677a);
    margin-bottom: 20px;
    flex: 1;
}

.program-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bahari, #1c6e8c);
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.25s var(--ease-out),
                color 0.25s var(--ease-out),
                gap 0.25s var(--ease-out);
    align-self: flex-start;
}

.program-btn::after {
    content: '→';
    transition: transform 0.25s var(--ease-out);
}

.program-btn:hover {
    color: var(--bahari-deep, #0b3b4d);
    border-bottom-color: var(--brass, #b8863b);
    gap: 10px;
}

.program-btn:hover::after {
    transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   Teachers Carousel — Refined
   -------------------------------------------------------------------------- */
.teachers-carousel-container {
    position: relative;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 60px;
}

.teachers-carousel-wrapper {
    overflow: hidden;
    border-radius: var(--card-radius);
}

.teacher-card {
    border-radius: var(--card-radius);
    background: var(--white, #fff);
    border: 1px solid var(--gray-200, #e9ecee);
    overflow: hidden;
    transition: transform 0.3s var(--ease-out),
                box-shadow 0.3s var(--ease-out);
    text-align: center;
}

.teacher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(16, 34, 44, 0.1);
}

.teacher-image {
    height: 240px;
    background: linear-gradient(135deg, #e8eef1, #d7e0e5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.teacher-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

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

.teacher-info {
    padding: 20px 18px 24px;
}

.teacher-info h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink, #10222c);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.teacher-role {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--brass, #b8863b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--gray-300, #d7dce0);
    background: var(--white, #fff);
    color: var(--bahari, #1c6e8c);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease-out);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(16, 34, 44, 0.08);
}

.carousel-btn:hover {
    background: var(--bahari, #1c6e8c);
    color: var(--white, #fff);
    border-color: var(--bahari, #1c6e8c);
    box-shadow: 0 4px 16px rgba(28, 110, 140, 0.3);
}

.carousel-btn.prev-btn { left: 0; }
.carousel-btn.next-btn { right: 0; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}

.carousel-dots button {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 0;
    background: var(--gray-300, #d7dce0);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    padding: 0;
}

.carousel-dots button.active {
    width: 24px;
    background: var(--brass, #b8863b);
}

/* --------------------------------------------------------------------------
   CTA Section — Dramatic
   -------------------------------------------------------------------------- */
.cta-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.cta-content h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--ink, #10222c);
    margin-bottom: 16px;
}

.cta-content p {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink-soft, #55677a);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 14px 32px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s var(--ease-out);
}

.cta-buttons .btn-primary {
    background: var(--bahari, #1c6e8c);
    color: var(--white, #fff);
    border: 1px solid var(--bahari, #1c6e8c);
    box-shadow: 0 4px 16px rgba(28, 110, 140, 0.25);
}

.cta-buttons .btn-primary:hover {
    background: var(--bahari-deep, #0b3b4d);
    border-color: var(--bahari-deep, #0b3b4d);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(28, 110, 140, 0.35);
}

/* --------------------------------------------------------------------------
   Hero Slides — Enhanced
   -------------------------------------------------------------------------- */
.hero.hero-has-slides {
    background-image: none !important;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.hero.hero-has-slides::after {
    background: var(--white, #fff);
    z-index: 1;
}

.hero-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.35s var(--ease-out);
    padding: 0;
}

.hero-dots button.active {
    width: 28px;
    background: var(--brass-light, #d4af6a);
}

.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(11, 59, 77, 0.35);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-out);
    backdrop-filter: blur(4px);
}

.hero-nav:hover {
    background: rgba(11, 59, 77, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
}

.hero-nav.prev { left: 24px; }
.hero-nav.next { right: 24px; }

/* --------------------------------------------------------------------------
   Responsive Refinements
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .teachers-carousel-container {
        padding: 0 50px;
    }
}

@media (max-width: 768px) {
    .hero.hero-has-slides {
        min-height: 75vh;
    }

    .hero-content {
        padding: 0 4px;
    }

    .hero-content h1 {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
    }

    .hero-content p {
        font-size: 0.9375rem;
    }

    .hero-dots {
        bottom: 20px;
    }

    .hero-nav {
        display: none;
    }

    .features,
    .programs-grid {
        padding: 0 16px;
        gap: 16px;
    }

    .feature {
        padding: 24px 20px;
    }

    .teachers-carousel-container {
        padding: 0 16px;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
    }

    .carousel-btn.prev-btn { left: -4px; }
    .carousel-btn.next-btn { right: -4px; }

    .teacher-image {
        height: 200px;
    }

    .cta-buttons .btn {
        padding: 12px 24px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 0.9375rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}

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