/* Story Templates Shared CSS */
/* Common styles for single-story.php, single-story-split.php, and single-story-video.php */

/* CSS Variables for Story Templates */
:root {
    --content-bg: white;
    --text-color: #000;
    --text-color-muted: #808080;
    --link-color: #808080;
    --link-hover-color: #39e58f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --content-bg: #050505;
        --text-color: white;
        --text-color-muted: #a8a8a8;
        --link-color: white;
        --link-hover-color: #39e58f;
    }
}

/* Global background for story pages */
html, body {
    background: var(--content-bg);
    min-height: 100vh;
}

/* Main Content */
.main-content {
    margin-top: 0;
    min-height: calc(100vh - 200px);
    padding: 0 2vw;
    padding-left: calc(2vw + env(safe-area-inset-left));
    padding-right: calc(2vw + env(safe-area-inset-right));
    width: 100vw;
    max-width: 100vw;
    background: var(--content-bg);
    position: relative;
    z-index: 10;
}

/* Story Content Styles */
.story-single-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 3rem 2vw 0 2vw;
}

/* Content wrapper for proper text centering within full-width container */
.story-content-wrapper {
    max-width: none;
    margin: 0 auto;
    width: 100%;
}

.story-content-inner {
    font-family: var(--serif-font);
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* Text elements limited to 900px width */
.story-content-inner p,
.story-content-inner h1,
.story-content-inner h2,
.story-content-inner h3,
.story-content-inner h4,
.story-content-inner h5,
.story-content-inner h6,
.story-content-inner ul,
.story-content-inner ol,
.story-content-inner blockquote {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* H1 specific styling - center aligned */
.story-content-inner h1,
.story-content-inner h1.wp-block-heading {
    text-align: center !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
}

/* H3 specific styling - left aligned within container, properly centered */
.story-content-inner h3,
.story-content-inner h2.wp-block-heading,
.story-content-inner h3.wp-block-heading,
.story-content-inner h4.wp-block-heading,
.story-content-inner h5.wp-block-heading,
.story-content-inner h6.wp-block-heading {
    text-align: left;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    display: block !important;
}

/* Body paragraph styling - Legitima serif font for story pages */
.story-content-inner p:not(.story-meta) {
    font-family: var(--serif-font) !important;
    font-size: 1.5rem !important;
    margin-bottom: 1.5rem;
}

.story-content-inner p.story-meta {
    margin-top: 16px;
}

/* Full-width images within container */
.story-content-inner img {
    width: 100%; /* Full width of container */
    max-width: 100%;
    margin: 2rem auto 0 auto; /* Remove bottom margin */
    display: block;
}

/* UAGB image blocks - ensure proper centering */
.story-content-inner .wp-block-uagb-image {
    width: 100%;
    max-width: 100%;
    margin: 1.5rem auto 0 auto;
    display: block;
    text-align: center;
}

.story-content-inner .wp-block-uagb-image figure,
.story-content-inner .wp-block-uagb-image .wp-block-uagb-image__figure {
    margin: 0;
    text-align: center;
    width: 100%;
}

/* Simple image caption below image */
.story-image-caption {
    font-family: var(--primary-font);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: left; /* Bottom-left alignment */
    margin-top: 8px;
    margin-bottom: 32px; /* Add 32px bottom padding */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.story-image-caption .caption-text {
    font-weight: 600; /* Semi-bold for caption */
    color: var(--text-color-muted); /* Use grey color variable */
    display: inline; /* Same line */
}

.story-image-caption .credit-text {
    font-weight: 400; /* Regular for credit */
    color: var(--text-color-muted);
    display: inline; /* Same line */
}

.story-image-caption .credit-text::before {
    content: " "; /* Space before credit */
}

.story-image-caption .pipe-separator {
    font-weight: 400; /* Regular weight */
    color: var(--text-color-muted); /* Same grey as text */
}

.story-content-inner h2 {
    font-family: var(--serif-font);
    font-size: 2.5rem;
    font-weight: 400;
    margin: 2rem 0 1rem 0;
    color: var(--text-color);
}

.story-content-inner h3 {
    font-family: var(--serif-font);
    font-size: 1.875rem;
    font-weight: 400;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-color);
}

/* Story content links */
.story-content-inner a {
    color: var(--text-color-muted);
    text-decoration: none;
}

.story-content-inner a:hover {
    color: var(--link-hover-color);
}

/* Audio block styling - matches contact button */
.story-content-inner .wp-block-audio,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio {
    max-width: 900px;
    margin: 0 auto !important;
    padding: 20px;
    background: var(--content-bg);
    border: 1px solid var(--highlight-color);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.story-content-inner .wp-block-audio:hover,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio:hover {
    background: rgba(57, 229, 143, 0.05);
}

.story-content-inner .wp-block-audio audio,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio audio {
    width: 100% !important;
    outline: none;
    height: 54px;
    border-radius: 25px;
}

/* Style the audio controls */
.story-content-inner .wp-block-audio audio::-webkit-media-controls-panel,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio audio::-webkit-media-controls-panel {
    background: transparent;
}

.story-content-inner .wp-block-audio audio::-webkit-media-controls-play-button,
.story-content-inner .wp-block-audio audio::-webkit-media-controls-current-time-display,
.story-content-inner .wp-block-audio audio::-webkit-media-controls-time-remaining-display,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio audio::-webkit-media-controls-play-button,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio audio::-webkit-media-controls-current-time-display,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-color);
}

.story-content-inner .wp-block-audio audio::-webkit-media-controls-timeline,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio audio::-webkit-media-controls-timeline {
    color: var(--highlight-color);
}

.story-content-inner .wp-block-audio figcaption,
.story-content-inner .uagb-container-inner-blocks-wrap .wp-block-audio figcaption {
    font-family: var(--primary-font);
    font-size: 0.875rem;
    color: var(--text-color-muted);
    margin-top: 12px;
    text-align: center;
}

.story-image-credit {
    font-size: 0.75rem;
    color: var(--text-color-muted);
    text-align: right;
    margin-top: 4px;
    padding: 2px 0;
}

/* Override base-sections.css h2 styling for more_stories shortcode */
.architecture-scroll-item h2 {
    font-size: 1.5rem !important;
}

/* Caption styling for more_stories shortcode - match homepage architecture scroller */
.architecture-scroll-item .caption {
    font-size: 0.75rem;
    color: var(--text-color-muted);
    text-align: left;
    padding: 4px 0 8px 0;
    margin: 0;
    background: transparent;
}

/* Ensure story-link elements in more_stories don't interfere with caption positioning */
.architecture-scroll .architecture-scroll-item .story-link {
    flex-grow: 0;
    flex-shrink: 0;
}

/* Story-specific header modifications */
.story-header-nav {
    position: absolute;
    left: calc(2vw + env(safe-area-inset-left));
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-family: var(--primary-font);
    font-size: 1.25rem;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
}

.site-header:not(.over-full-bleed) .story-header-nav {
    color: #000 !important;
}

.story-header-contact {
    position: absolute;
    right: calc(2vw + env(safe-area-inset-right));
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--primary-font);
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
}

.site-header:not(.over-full-bleed) .story-header-contact {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #000 !important;
    color: #000 !important;
}

.story-header-contact:hover {
    background: white !important;
    color: #000 !important;
}

.site-header:not(.over-full-bleed) .story-header-contact:hover {
    background: #000 !important;
    color: white !important;
}

/* Dark mode story header styling */
@media (prefers-color-scheme: dark) {
    .site-header:not(.over-full-bleed) .story-header-nav {
        color: white !important;
    }

    .site-header:not(.over-full-bleed) .story-header-contact {
        background: rgba(255, 255, 255, 0.1) !important;
        border-color: white !important;
        color: white !important;
    }

    .site-header:not(.over-full-bleed) .story-header-contact:hover {
        background: white !important;
        color: #000 !important;
    }
}

/* Caption styling for photo credits */
.caption {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-family: var(--primary-font);
    font-size: 0.75rem;
    color: white;
    z-index: 10;
}

/* Tablet/Desktop Responsive adjustments */
@media (max-width: 1200px) {
    .story-content-inner .wp-block-uagb-image {
        margin-top: 0.5rem;
    }

    .story-content-inner .wp-block-uagb-image img {
        margin-top: 0 !important;
    }

    .story-header-nav {
        font-size: 1rem;
    }

    .story-header-contact {
        font-size: 0.875rem;
    }

    .architecture-scroll {
        gap: 24px;
    }
}

/* Mobile Responsive - See breakpoint reference in plugin base-sections.css */
@media (max-width: 768px), ((max-width: 1200px) and (max-height: 768px)) {
    .main-content {
        padding: 0 4vw;
    }

    .story-single-container {
        padding: 2rem 4vw;
    }

    .story-content-inner {
        font-size: 1.25rem;
    }

    /* Mobile responsive paragraph sizing */
    .story-content-inner p:not(.story-meta) {
        font-size: 1.25rem !important;
    }

    /* Mobile images use full container width */
    .story-content-inner img {
        width: 100%;
        max-width: 100%;
    }

    .story-content-inner .wp-block-uagb-image {
        width: 100%;
        max-width: 100%;
        margin-top: 0.5rem;
    }

    .story-content-inner .wp-block-uagb-image img {
        margin-top: 0 !important;
    }

    .story-image-caption {
        width: 100%;
        margin-bottom: 1rem;
    }

    .story-header-nav {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px), ((max-width: 1200px) and (max-height: 480px)) {
    .story-header-nav {
        font-size: 1rem;
    }

    /* Small mobile responsive paragraph sizing */
    .story-content-inner p:not(.story-meta) {
        font-size: 1.125rem !important;
    }
}

/* Architecture Scroller - Comprehensive Styling for Story Pages */
.architecture-scroll {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: 16px; /* Space for scrollbar */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Custom scrollbar styling for architecture scroll */
.architecture-scroll::-webkit-scrollbar {
    height: 8px;
}

.architecture-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.architecture-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.architecture-scroll::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Dark mode scrollbar */
@media (prefers-color-scheme: dark) {
    .architecture-scroll::-webkit-scrollbar-track {
        background: #2a2a2a;
    }

    .architecture-scroll::-webkit-scrollbar-thumb {
        background: #555;
    }

    .architecture-scroll::-webkit-scrollbar-thumb:hover {
        background: #666;
    }
}

/* Scroll Items - Match Photography section dimensions */
.architecture-scroll-item {
    flex: 0 0 450px; /* Fixed width for horizontal scroll */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Architecture section image styling - match story grid 4:3 aspect ratio */
.architecture-scroll-item .story-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.architecture-scroll-item .story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin-top: 0 !important;
}

/* Architecture scroll area text spacing and styling */
.architecture-scroll-item .story-content h2 {
    margin-top: 16px;
    margin-bottom: 16px;
    font-size: 1.5rem !important; /* 24px headline on desktop */
    font-family: var(--serif-font) !important;
}

.architecture-scroll-item .story-link:hover h2 {
    color: var(--highlight-color);
}

.architecture-scroll-item .story-content p:not(.story-meta) {
    margin-bottom: 16px;
    color: var(--text-color-muted); /* Grey standfirst text */
    font-family: var(--serif-font) !important;
}

.architecture-scroll-item .story-content .story-meta {
    margin-bottom: 0;
    font-family: var(--primary-font) !important; /* Innovator Grotesk font */
    font-size: 0.875rem;
    color: var(--text-color-muted);
}

/* Responsive - Mobile - See breakpoint reference in plugin base-sections.css */
@media (max-width: 768px), ((max-width: 1200px) and (max-height: 768px)) {
    .architecture-scroll {
        gap: 16px;
    }

    .architecture-scroll-item {
        flex: 0 0 220px; /* Mobile width */
    }

    .architecture-scroll-item .story-content h2 {
        margin-top: 8px;
        margin-bottom: 12px;
        font-size: 1.25rem !important; /* Smaller on mobile */
    }

    .architecture-scroll-item .story-content p:not(.story-meta) {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px), ((max-width: 1200px) and (max-height: 480px)) {
    .architecture-scroll {
        gap: 16px;
    }

    .architecture-scroll-item {
        flex: 0 0 220px; /* Small mobile width */
    }

    .architecture-scroll-item .story-content h2 {
        font-size: 1.125rem !important; /* Smaller on small mobile */
    }
}
