/* Editorial Collapsible - Frontend Styles */

/* Import premium editorial fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&family=Cormorant+Garamond:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --editorial-transition-duration: 0.6s;
    --editorial-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --editorial-content-padding: 3rem;
}

.editorial-collapsible-wrapper {
    margin: 3rem 0;
    position: relative;
}

/* Header/Trigger Styling */
.editorial-collapsible-trigger {
    width: 100%;
    position: relative;
    overflow: hidden;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    display: block;
    border-radius: 2px;
    transition: all var(--editorial-transition-duration) var(--editorial-transition-easing);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.editorial-collapsible-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
}

.editorial-collapsible-trigger:focus {
    outline: 3px solid rgba(0, 0, 0, 0.1);
    outline-offset: 4px;
}

/* Image Wrapper */
.header-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.header-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--editorial-transition-easing);
}

.editorial-collapsible-trigger:hover .header-image-wrapper img {
    transform: scale(1.05);
}

/* Image Overlay Styles */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    transition: opacity 0.4s ease;
}

.overlay-style-gradient .image-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

.overlay-style-solid .image-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.overlay-style-minimal .image-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.15) 100%
    );
}

/* Text Overlay */
.header-text-overlay {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 3rem;
    color: #ffffff;
}

/* Add backdrop shim behind text */
.header-text-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* Text Positioning */
.overlay-top-left .header-text-overlay {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.overlay-top-center .header-text-overlay {
    justify-content: flex-start;
    align-items: center;
    text-align: center;
}

.overlay-top-right .header-text-overlay {
    justify-content: flex-start;
    align-items: flex-end;
    text-align: right;
}

.overlay-center .header-text-overlay {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.overlay-bottom-left .header-text-overlay {
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
}

.overlay-bottom-center .header-text-overlay {
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}

.overlay-bottom-right .header-text-overlay {
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
}

/* Typography - Editorial Style */
.header-main-text {
    margin: 0;
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #ffffff !important;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.8);
    transition: transform 0.4s var(--editorial-transition-easing);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

.editorial-collapsible-trigger:hover .header-main-text {
    transform: translateY(-4px);
}

.header-subtext {
    margin: 1rem 0 0;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 400;
    color: #ffffff !important;
    opacity: 0.98;
    line-height: 1.5;
    letter-spacing: 0.01em;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 3px 12px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.7);
    max-width: 600px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Expand Icon */
.expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    transition: all 0.4s var(--editorial-transition-easing);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.expand-icon svg {
    width: 24px;
    height: 24px;
    transition: transform var(--editorial-transition-duration) var(--editorial-transition-easing);
}

.editorial-collapsible-trigger:hover .expand-icon {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(4px);
}

.editorial-collapsible-trigger[aria-expanded="true"] .expand-icon svg {
    transform: rotate(180deg);
}

/* Collapsible Panel */
.editorial-collapsible-panel {
    overflow: hidden;
    transition: all var(--editorial-transition-duration) var(--editorial-transition-easing);
    max-height: 0;
    opacity: 0;
}

.editorial-collapsible-panel[aria-hidden="false"] {
    max-height: 100000px;
    opacity: 1;
}

.panel-inner {
    padding: var(--editorial-content-padding);
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 2px 2px;
    animation: fadeInUp 0.6s var(--editorial-transition-easing);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Styling */
.panel-inner > * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
}

.panel-inner > *:first-child {
    margin-top: 0;
}

.panel-inner > *:last-child {
    margin-bottom: 0;
}

.panel-inner p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #333;
    margin-bottom: 1.25rem;
}

.panel-inner h1,
.panel-inner h2,
.panel-inner h3,
.panel-inner h4 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    :root {
        --editorial-content-padding: 2rem;
    }

    .header-text-overlay {
        padding: 2rem 1.5rem;
    }

    .header-main-text {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    .header-subtext {
        font-size: clamp(0.95rem, 3vw, 1.15rem);
        margin-top: 0.75rem;
    }

    .expand-icon {
        width: 40px;
        height: 40px;
        margin-top: 1rem;
    }

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

    .panel-inner {
        padding: 1.75rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .editorial-collapsible-wrapper {
        margin: 2rem 0;
    }

    .header-text-overlay {
        padding: 1.5rem 1.25rem;
    }

    .panel-inner {
        padding: 1.5rem 1rem;
    }

    .panel-inner p {
        font-size: 1rem;
    }
}

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

    .editorial-collapsible-trigger:hover {
        transform: none;
    }

    .editorial-collapsible-trigger:hover .header-image-wrapper img {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .editorial-collapsible-panel {
        max-height: none !important;
        opacity: 1 !important;
    }

    .editorial-collapsible-trigger {
        page-break-inside: avoid;
    }

    .expand-icon {
        display: none;
    }
}
