/* ==========================================================
   SANWAL ARCHITECTS - JOURNAL / BLOG CSS
   Premium Architectural Magazine Style
   ========================================================== */

/* --- Hero Section (Full-Width Background Image) --- */
.journal-hero {
    position: relative;
    width: 100%;
    height: var(--journal-hero-height, 70vh);
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    isolation: isolate;
    margin-top: var(--header-h, 90px);
}

/* Background image div — no <img> to avoid layout shift */
.journal-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('../images/journal-hero.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    will-change: transform;   /* GPU layer */
    z-index: 0;
}

/* Premium dual-layer overlay: base opacity + gradient lift at bottom */
.journal-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top,  rgba(0,0,0,0.70) 0%, rgba(0,0,0,0.30) 55%, rgba(0,0,0,0.45) 100%);
    z-index: 1;
}

/* Container sits above both bg and overlay */
.journal-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.journal-hero-left {
    max-width: 600px;
    text-align: left;
}

.journal-hero-title {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: clamp(3.5rem, 7vw, 6rem);
    line-height: 1.0;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: -1px;
    font-weight: 400;
}

.journal-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.78);
    line-height: 1.75;
    max-width: 520px;
}

.journal-hero-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.journal-counter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-left: 2px solid var(--accent, #c8a96b);
    padding-left: 24px;
}

.journal-counter-number {
    font-family: var(--font-heading, serif);
    font-size: 4.5rem;
    line-height: 1;
    color: #fff;
    font-weight: 400;
    margin-bottom: 4px;
}

.journal-counter-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent, #c8a96b);
}

/* --- Category Nav & Search --- */
.journal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 20px;
}

.journal-categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.journal-categories::-webkit-scrollbar { display: none; }

.category-pill {
    padding: 10px 24px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 30px;
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: transparent;
}

.category-pill:hover,
.category-pill.active {
    background: var(--accent, #c8a96b);
    border-color: var(--accent, #c8a96b);
    color: #000;
}

.journal-search {
    position: relative;
    width: 300px;
}

.journal-search input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 12px 16px 12px 40px;
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.journal-search input:focus {
    outline: none;
    border-color: var(--accent, #c8a96b);
    background: rgba(255,255,255,0.06);
}

.journal-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

/* --- Masonry Grid --- */
.journal-grid-wrapper {
    display: flex;
    gap: 40px;
}

.journal-grid-main {
    flex: 1;
}

.journal-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.journal-grid {
    display: grid;
    /* Default to 1 column for mobile */
    grid-template-columns: 1fr;
    gap: 30px;
    opacity: 0; /* for animation */
    transform: translateY(20px);
    transition: opacity 0.6s, transform 0.6s;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .journal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Laptop: 2 or 3 columns depending on space (auto-fit fits 3 if possible) */
@media (min-width: 992px) {
    .journal-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Desktop: exactly 3 columns */
@media (min-width: 1200px) {
    .journal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.journal-grid.loaded {
    opacity: 1;
    transform: translateY(0);
}

.journal-card {
    background: #15181e;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.32s, border-color 0.32s;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    /* Reset link default styles */
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    outline-offset: 3px;
}

.journal-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(0,0,0,0.45);
    border-color: rgba(200,169,107,0.35);
}

.journal-card-img-wrap {
    height: 210px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.journal-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.journal-card:hover .journal-card-img {
    transform: scale(1.08);
}

.journal-card-category {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: var(--accent, #c8a96b);
    padding: 6px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
    border: 1px solid rgba(200,169,107,0.3);
}

.journal-card-content {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.journal-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #777;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.journal-card-title {
    font-size: 1.1rem;
    font-family: var(--font-heading, serif);
    line-height: 1.35;
    color: #e5e5e5;
    margin-bottom: 8px;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.journal-card:hover .journal-card-title {
    color: var(--accent, #c8a96b);
}

.journal-card-excerpt {
    color: #999;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.journal-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;                              /* guaranteed minimum gap */
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 12px;
    margin-top: auto;
    flex-shrink: 0;
}

.journal-author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bbb;
    font-size: 0.85rem;
    /* Truncate gracefully — never push or overlap the read-more button */
    min-width: 0;
    overflow: hidden;
}

.journal-author span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.journal-read-more {
    color: var(--accent, #c8a96b);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;                        /* never collapse — always stay on the right */
    white-space: nowrap;
}

.journal-read-more svg {
    transition: transform 0.3s;
}
.journal-card:hover .journal-read-more svg {
    transform: translateX(4px);
}


/* --- Sidebar removed --- */

/* ==========================================================================
   3. ARTICLE DETAILS (article.html)
   ========================================================================== */
.article-hero {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
    margin-top: var(--header-h, 90px);
}

.article-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0f1115 0%, rgba(15,17,21,0.6) 50%, rgba(15,17,21,0.3) 100%);
}

.article-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: var(--accent, #c8a96b);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.article-title {
    font-family: var(--font-heading, serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: #fff;
    line-height: 1.15;
    margin-bottom: 30px;
}

.article-author-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: #a0a0a0;
    font-size: 0.95rem;
}

.article-container {
    max-width: 900px;
    margin: 60px auto 100px;
    padding: 0 20px;
}

/* Rich Text Formatting */
.article-content {
    font-size: 1.12rem;
    line-height: 1.85;
    color: #d1d1d1;
    font-family: 'Inter', sans-serif;
}
.article-content h1 {
    font-family: var(--font-heading, serif);
    font-size: 2.4rem;
    color: #fff;
    margin: 50px 0 20px;
    line-height: 1.2;
}
.article-content h2 {
    font-family: var(--font-heading, serif);
    font-size: 2rem;
    color: #fff;
    margin: 48px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(200,169,107,0.2);
}
.article-content h3 {
    font-family: var(--font-heading, serif);
    font-size: 1.55rem;
    color: #efefef;
    margin: 36px 0 14px;
}
.article-content h4 {
    font-size: 1.25rem;
    color: #e0e0e0;
    margin: 28px 0 10px;
    font-weight: 600;
}
.article-content h5, .article-content h6 {
    font-size: 1.05rem;
    color: #ccc;
    margin: 20px 0 8px;
}
.article-content p { margin-bottom: 22px; }
.article-content ul, .article-content ol {
    margin: 20px 0 24px 0;
    padding-left: 28px;
}
.article-content ul { list-style: none; padding-left: 0; }
.article-content ul > li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    color: #d1d1d1;
}
.article-content ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 6px;
    height: 6px;
    background: var(--accent, #c8a96b);
    border-radius: 50%;
}
.article-content ol { list-style: decimal; }
.article-content ol > li {
    margin-bottom: 10px;
    color: #d1d1d1;
    padding-left: 6px;
}
.article-content li > ul,
.article-content li > ol { margin: 8px 0 8px 0; }
.article-content strong, .article-content b { color: #fff; font-weight: 700; }
.article-content em, .article-content i { font-style: italic; color: #e0e0e0; }
.article-content u { text-underline-offset: 4px; }
.article-content s { color: #777; }
.article-content code {
    background: rgba(200,169,107,0.1);
    border: 1px solid rgba(200,169,107,0.2);
    color: var(--accent, #c8a96b);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    padding: 2px 7px;
    border-radius: 4px;
}
.article-content pre {
    background: #0d0f13;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 24px;
    overflow-x: auto;
    margin: 30px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #b0c4de;
}
.article-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 36px auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.article-content blockquote {
    border-left: 4px solid var(--accent, #c8a96b);
    padding: 20px 30px;
    background: rgba(200,169,107,0.05);
    font-size: 1.25rem;
    font-style: italic;
    color: #fff;
    margin: 40px 0;
    border-radius: 0 8px 8px 0;
}
.article-content hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 40px 0;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
}
.article-content th {
    background: rgba(200,169,107,0.15);
    color: var(--accent, #c8a96b);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.08);
}
.article-content td {
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.06);
    color: #ccc;
}
.article-content tr:nth-child(even) td { background: rgba(255,255,255,0.03); }
.article-content a {
    color: var(--accent, #c8a96b);
    text-decoration: underline;
    text-decoration-color: rgba(200,169,107,0.4);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.3s;
}
.article-content a:hover {
    text-decoration-color: var(--accent, #c8a96b);
}

/* Article Tags */
.article-tags {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.article-tags-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #777;
    margin-bottom: 12px;
}
.article-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.article-tag {
    display: inline-block;
    background: rgba(200,169,107,0.08);
    border: 1px solid rgba(200,169,107,0.25);
    color: var(--accent, #c8a96b);
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background 0.3s;
}
.article-tag:hover { background: rgba(200,169,107,0.15); }


/* --- Responsive --- */
@media (max-width: 1024px) {
    /* Tablet: Journal Landing Hero 55–60vh */
    .journal-hero {
        height: var(--journal-hero-height, 58vh);
        min-height: 420px;
    }
    /* Tablet: Single Article Hero 50–55vh */
    .article-hero {
        height: 52vh;
        min-height: 400px;
        padding-bottom: 50px;
    }
}
@media (max-width: 992px) {
    .journal-grid-wrapper { flex-direction: column; }
    .journal-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}
@media (max-width: 768px) {
    .journal-controls { flex-direction: column; align-items: stretch; }
    .journal-search { width: 100%; }

    /* Mobile: Journal Landing Hero 45–50vh */
    .journal-hero {
        height: var(--journal-hero-height, 47vh);
        min-height: 340px;
    }
    .journal-hero-inner { flex-direction: column; text-align: center; gap: 30px; }
    .journal-hero-left { text-align: center; }
    .journal-counter {
        border-left: none;
        border-top: 2px solid var(--accent, #c8a96b);
        padding-left: 0;
        padding-top: 20px;
        align-items: center;
    }
    .journal-hero-title { font-size: clamp(2.4rem, 8vw, 3.5rem); }
    .journal-hero-subtitle { font-size: 0.95rem; margin: 0 auto; }

    /* Mobile: Single Article Hero 40–45vh */
    .article-hero {
        height: 42vh;
        min-height: 300px;
        padding-bottom: 40px;
    }
    .article-title {
        font-size: clamp(1.8rem, 6vw, 2.8rem);
    }
}
