/*
Theme Name: CTC Mag Custom Theme
Author: Clémence Mackenzie Dehais
Description: A highly optimized, scratch-built theme with dynamic Gutenberg block support.
Version: 1.2
*/

/* ==========================================================================
   1. DEFINE TYPOGRAPHY FONTS (CONTEXT-RELATIVE ANCHOR)
   ========================================================================== */
@font-face {
    font-family: 'Horizon';
    src: url('./Fonts/Horizon.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Performance Optimization: Prevent invisible text during loading */
}

@font-face {
    font-family: 'Horizon Outlined';
    src: url('./Fonts/Horizon_Outlined.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Didact Gothic';
    src: url('./Fonts/DidactGothic-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   2. GLOBAL DESIGN TOKENS & UNIVERSAL CONFIGURATIONS
   ========================================================================== */
:root {
    --font-heading: 'Horizon', sans-serif;
    --font-outline: 'Horizon Outlined', sans-serif;
    --font-body: 'Didact Gothic', sans-serif;
    
    --color-dark: #111;
    --color-muted: #222;
    --color-charcoal: #333;
    --color-gray: #444;
    --color-byline: #555;
    
    --transition-smooth-duration: 0.5s;
    --transition-smooth-easing: cubic-bezier(0.25, 0.8, 0.25, 1);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background-color: transparent;
}

body {
    background-image: url('./Images/Website_Base.webp');
    background-attachment: fixed;
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   3. STRUCTURAL CONTENT CONTAINER & SYSTEM STATES
   ========================================================================== */
.text-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 40px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    height: auto;
    overflow: visible;
}

.article-content {
    filter: none;
    pointer-events: auto;
    user-select: auto;
    opacity: 1;
}

/* ==========================================================================
   4. EDITORIAL TYPOGRAPHY STYLING & ACCENTS
   ========================================================================== */
h1 {
    font-family: var(--font-heading);
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--color-dark); 
    font-size: 2.6rem; 
    line-height: 1.15;
    word-wrap: break-word;
}

h2, h3, h4 {
    font-family: var(--font-heading);
}

h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--color-charcoal);
    font-size: 1.3rem;
    line-height: 1.4;
}

h3 {
    margin-top: 50px;
    margin-bottom: 15px;
    color: var(--color-muted);
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    padding-bottom: 5px;
}

h4 {
    margin-top: 35px;
    margin-bottom: 10px;
    color: var(--color-gray);
    font-size: 0.95rem;
}

p {
    font-family: var(--font-body);
    margin-top: 0;
    margin-bottom: 1.6rem;
    line-height: 1.65;
    font-size: 1.1rem; 
    color: var(--color-muted);
}

.byline {
    font-family: var(--font-body);
    font-weight: bold;
    color: var(--color-byline);
    margin-bottom: 2px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.disclaimer {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--color-gray);
    margin-top: 0;
    margin-bottom: 40px;
    font-size: 0.85rem;
}

.inline-outline {
    font-family: var(--font-outline);
    font-weight: normal;
}

/* ==========================================================================
   5. RESPONSIVE MEDIA SCALING & VIEWPORT PARSING
   ========================================================================== */
@media screen and (max-width: 768px) {
    .text-container {
        margin: 20px auto;
        padding: 20px;
    }
    h1 {
        font-size: 1.9rem;
    }
    h2 {
        font-size: 1.1rem;
    }
    h3 {
        font-size: 1.05rem;
        margin-top: 35px;
    }
}

/* ==========================================================================
   6. NATIVE WORDPRESS BLOCK EDITOR (GUTENBERG) OVERRIDES
   ========================================================================== */

/* Maps native block groupings to your unified core layouts */
.wp-block-group, .wp-block-unit {
    margin-bottom: 2rem;
}

/* Automatically formats standard Dashboard Columns cleanly */
.wp-block-columns {
    display: flex;
    gap: 20px;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

@media screen and (min-width: 600px) {
    .wp-block-columns {
        flex-wrap: nowrap;
    }
}

.wp-block-column {
    flex-grow: 1;
    flex-basis: 0;
    min-width: 0;
}

/* Forces standard dashboard Gallery Blocks into your lookbook scrollbar format */
.wp-block-gallery {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 24px !important;
    padding-bottom: 20px;
    margin-bottom: 2.5rem;
    -webkit-overflow-scrolling: touch; /* Butter-smooth scroll mapping on iOS devices */
}

/* Normalizes the inner list configurations generated by newer WordPress blocks */
.wp-block-gallery.wp-block-gallery-1, 
ul.wp-block-gallery {
    list-style-type: none;
    padding-left: 0;
}

/* Guarantees that images inside galleries strictly preserve lookbook layout ratios */
.wp-block-gallery .wp-block-image,
.wp-block-gallery li.blocks-gallery-item {
    flex: 0 0 290px !important;
    max-width: 290px !important;
    margin: 0 !important;
}

.wp-block-gallery img {
    width: 100% !important;
    height: auto !important;
    display: block;
    object-fit: cover;
}

/* Custom Minimalist Trackbar Framing */
.wp-block-gallery::-webkit-scrollbar {
    height: 4px;
}

.wp-block-gallery::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

.wp-block-gallery::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.wp-block-gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}
