/* --- PAGES.CSS — Page-Specific Styles --- */


/* --- 1. SECTION WIDTHS --- */

#home .section-content,
#about .section-content       { max-width: 51.25rem; margin: 0 auto; }
#gallery .section-content     { max-width: 60rem;    margin: 0 auto; }
#projects .section-content,
#blog .section-content,
#blog-post-detail .section-content { max-width: 65rem; margin: 0 auto; }
#project-detail .section-content { max-width: 75rem; margin: 0 auto; }
#contact .section-content     { max-width: 48.75rem; margin: 0 auto; }


/* --- 2. HOME --- */

.home-section {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3xl);
}
.home-section:last-child { margin-bottom: 0; }
.home-section.reverse { flex-direction: row-reverse; }

.text-block {
    flex: 0 1 auto;
    max-width: 55%;
}
.text-block p {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.3;
    color: var(--color-text-secondary);
    margin: 0;
    text-align: right;
}
.home-section.reverse .text-block p { text-align: left; }

.home-image {
    flex: 0 1 auto;
    max-width: 45%;
    border-radius: var(--radius-lg);
}

/* Desktop: larger text, wider image */
@media (min-width: 651px) {
    .home-section { gap: var(--space-xl); }
    .text-block { max-width: 50%; }
    .text-block p { font-size: 1.8rem; }
    .home-image { max-width: clamp(220px, 50%, 380px); }
}


/* --- 3. ABOUT --- */

#about .section-content { text-align: left; }

.about-container {
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}

/* --- Profile Header: horizontal — avatar left, name + tagline right --- */
.about-profile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-lg);
    text-align: left;
    margin-bottom: var(--space-2xl);
    perspective: 800px;
}

.about-profile .coin-wrapper {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.about-profile-text {
    display: flex;
    flex-direction: column;
}

.about-name {
    font-size: var(--text-3xl);
    margin-bottom: 0;
    line-height: 1.1;
}

.about-tagline {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin: var(--space-2xs) 0 0 0;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

@media (min-width: 651px) {
    .about-container { max-width: 520px; }

    .about-profile .coin-wrapper {
        width: 96px;
        height: 96px;
    }
    .about-name {
        font-size: var(--text-4xl);
    }
    .about-tagline {
        font-size: var(--text-base);
    }
}

/* --- Divider with centered icon --- 
   Major dividers get a small icon (sun) centered between two lines.
   Uses flexbox on the <hr> itself: ::before = left line, ::after = right line,
   background-image = the icon in the middle. 
   .divider.small is excluded — it stays as a plain line. */

.divider:not(.small) {
    border: none;
    display: flex;
    align-items: center;
    gap: 3px;
    height: auto;
}

.divider:not(.small)::before,
.divider:not(.small)::after {
    content: '';
    flex: 1;
    border-top: 2px dashed var(--color-border);
    transition: border-color var(--transition-theme);
    height: 0;
}

.divider-icon {
    display: block;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity var(--transition-theme);
    transform: translateY(-0.8px)
}

/* --- Divider between profile and content blocks --- */
#about .divider {
    margin-top: 0;
    margin-bottom: var(--space-2xl);
}

/* --- Content Blocks: identical pattern to contact-block --- */
.about-block {
    margin-bottom: 2.5rem;
}
.about-block:last-child {
    margin-bottom: 0;
}

/* Headings and description text inherit from the shared
   .heading, .prompt, and .description-text classes defined
   in the shared contact typography section (Section 11).
   No overrides needed — the about page speaks the same language. */

/* The data-link-container and data-link components are also
   shared with the contact page. About blocks use them identically,
   just with <div> instead of <a> for non-interactive rows. */

/* Non-link data rows: remove the hover cursor */
.about-block div.data-link {
    cursor: default;
}

/* About data-link labels and values: secondary color,
   matching the contact page's quieter data-row style */
.about-block .data-link {
    color: var(--color-text-secondary);
}
.about-block .link-label {
    color: inherit;
    font-size: 0.9em;
    opacity: 1; /* Match opacity of value */
}
.about-block .link-value {
    color: inherit;
}


/* --- 4. GALLERY GRID --- */

/* Mobile: 2-column fluid grid */
#gallery .grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    align-items: center;
    justify-content: center;
}

/* Mobile: stacked year headers (class set by gallery.js at render time) */
.gallery-year-header {
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: none;
}
.gallery-year-header:first-child {
    margin-top: 0;
}
.gallery-year-header h2,
.gallery-year-header h3 {
    display: block;
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-primary);
}
.gallery-year-header h3 {
    margin-top: var(--space-2xs);
}
.gallery-year-header h3::before { display: none; }

/* Desktop: 4-column fixed grid, inline year headers */
@media (min-width: 651px) {
    #gallery .grid {
        grid-template-columns: repeat(4, 8.125rem);
        gap: 3.75rem;
    }
    .gallery-year-header {
        margin-bottom: 3.5rem;
    }
    .gallery-year-header h2,
    .gallery-year-header h3 {
        display: inline-block;
        vertical-align: middle;
    }
    .gallery-year-header h3 {
        margin-top: 0;
    }
    .gallery-year-header h3::before {
        display: inline;
        content: "|";
        margin: 0 0.85rem;
    }
}


/* --- 5. PROJECTS GRID --- */

/* Mobile: single column */
#projects .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.875rem;
    justify-content: center;
}

/* Desktop: 2 columns */
@media (min-width: 651px) {
    #projects .grid {
        grid-template-columns: repeat(2, 21.875rem);
    }
}

/* Project card titles: primary color (base h3 defaults to secondary) */
.project-card h3 {
    color: var(--color-text-primary);
}


/* --- 6. BLOG GRID --- */

/* Mobile: 2-column fluid */
#blog .grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9375rem;
    justify-content: center;
}

#blog-post-detail,
#blog .section-content { text-align: left; }

/* Desktop: auto-fit with wider minimum */
@media (min-width: 651px) {
    #blog .grid {
        grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
        gap: 1.875rem;
    }
}


/* --- 7. BLOG POST DETAIL --- */

/* Mobile: compact padding */
#blog-post-content {
    max-width: 800px;
    margin: var(--space-xl) auto;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
}
#blog-post-content h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text-primary);
    text-align: left;
}
#blog-post-content .blog-meta {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    display: block;
    text-align: left;
    transition: color var(--transition-theme);
}
#blog-post-content p { font-size: 1rem; }

.blog-post-main-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-paragraphs p {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    text-align: left;
}

/* Desktop: wider padding, larger title */
@media (min-width: 651px) {
    #blog-post-content {
        padding: var(--space-2xl) var(--space-3xl);
    }
    #blog-post-content h2 {
        font-size: var(--text-3xl);
    }
}


/* --- 8. PROJECT DETAIL --- */

#project-detail .section-content { text-align: left; }

.project-detail-layout {
    display: flex;
    gap: var(--space-2xl);
    margin-top: var(--space-xl);
}
.project-detail-content { flex: 1; }

.project-detail-title {
    font-size: var(--text-3xl);
    margin-bottom: 0;
    text-align: left;
}
.project-detail-meta {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin: var(--space-xs) 0 var(--space-lg) 0;
    text-align: left;
    transition: color var(--transition-theme);
}
.project-detail-description p {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    text-align: left;
}

.project-media-container {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.project-media-container iframe {
    width: 100%;
    height: 500px;
    border: none;
    box-shadow: 0 4px 15px -2px var(--color-shadow);
    border-radius: var(--radius-md);
    background-color: transparent;
    transition: box-shadow var(--transition-theme), background-color var(--transition-theme);
}
.video-responsive {
    overflow: hidden;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
}
.video-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.media-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}
.media-actions .btn { margin-top: 0; width: auto; }


/* --- 9. CONTACT --- */

/* Mobile: stacked column, illustration on top */
.contact-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xl);
    text-align: left;
}
.contact-illustration {
    order: -1;
    flex: none;
    max-width: 280px;
}
.contact-details {
    flex: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: var(--space-xl);
}
.contact-block {
    flex: 1;
    min-width: 210px;
}
.contact-image {
    max-width: 100%;
    border-radius: var(--radius-lg);
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

/* Desktop: side-by-side */
@media (min-width: 651px) {
    .contact-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: var(--space-3xl);
    }
    .contact-illustration {
        order: 0;
        flex: 1;
        max-width: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .contact-details {
        flex: 1;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: auto;
        gap: 2.5rem;
    }
    .contact-block {
        min-width: auto;
    }
}

.contact-block h4 {
    font-size: var(--text-lg);
    margin: 0 0 var(--space-sm) 0;
    display: flex;
    align-items: center;
}
.contact-block p {
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin: 0 0 var(--space-md) 0;
}

#contact .divider {
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-2xl);
}


/* --- 10. CONTACT FORM — Dossier Style --- */

.contact-form-container {
    padding: 0;
    text-align: left;
}

.contact-form {
    text-align: left;
    display: flex;
    flex-direction: column;
}

/* --- Form Field: mirrors .data-link row structure --- */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 2px dashed var(--color-border);
    transition: border-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.form-field:focus-within {
    border-color: var(--color-accent);
}

.form-field-label {
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-weight: 700;
    color: var(--color-text-secondary);
    opacity: 0.8;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.form-field-label::before {
    content: '>';
    color: var(--color-accent);
    display: inline-block;
    width: 0;
    overflow: hidden;
    opacity: 0;
    transition: width 0.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s ease;
}

.form-field:focus-within .form-field-label::before {
    width: 1em;
    opacity: 1;
}

.form-field:focus-within .form-field-label {
    color: var(--color-accent);
    opacity: 1;
}

.contact-form input,
.contact-form textarea {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--color-text-primary);
    width: 100%;
    background: transparent;
    border: none;
    padding: var(--space-2xs) 0;
    box-sizing: border-box;
    outline: none;
    transition: color var(--transition-theme);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.45;
    font-style: normal;
}

/* --- Submit Row: mirrors .project-link / .read-more-link pattern --- */
.form-submit-row {
    padding-top: var(--space-xs);
}

.form-send-link {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0;
    transition: var(--transition-tech);
}
.form-send-link:hover {
    color: var(--color-accent);
}
.form-send-link .svg-icon {
    transition: var(--transition-tech);
    margin-top: 2px;
}
.form-send-link:hover .svg-icon {
    transform: translateX(4px);
}
.form-send-link:active {
    transform: scale(0.96);
    transition: transform 0.05s ease-out;
}

/* Desktop: right-align submit */
@media (min-width: 651px) {
    .form-submit-row {
        text-align: right;
    }
}


/* --- 11. SHARED CONTACT TYPOGRAPHY --- */

/* Heading with prompt */
.heading {
    display: flex;
    align-items: center;
    font-size: var(--text-lg);
    font-weight: 700;
}

.description-text {
    font-family: var(--font-secondary);
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin-bottom: var(--space-md);
}

/* Data links (terminal table) */
.data-link-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.data-link {
    font-family: var(--font-mono);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
a.data-link:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    text-decoration: none;
}

.link-label { font-weight: 700; font-size: 0.9em; opacity: 0.8; }
.link-value { font-weight: 400; text-align: right; }