/*
Theme Name: Archisphere
Theme URI: https://github.com/example/archisphere
Author: Antigravity AI
Author URI: https://github.com/example
Description: A premium, minimalist, and editorial WordPress theme tailored for architecture blogs, portfolios, and magazines. Clean typography, responsive masonry grid, built-in SEO schema markup, and dedicated AdSense Customizer panels make it optimized for performance and monetization.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: archisphere
Tags: architecture, blog, grid-layout, custom-menu, featured-images, translation-ready, one-column, two-columns, right-sidebar, accessibility-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool.
*/

/* ==========================================================================
   1. Design System & CSS Variables
   ========================================================================== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #0f1011;
    --text-primary: #18191a;
    --text-secondary: #5e646a;
    --text-muted: #8d939b;
    --accent: #a88a64; /* Sophisticated Bronze */
    --accent-hover: #8e7250;
    --border-color: #e9ecef;
    --border-dark: #2d3033;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --max-width: 1240px;
    --header-height: 80px;
}

/* ==========================================================================
   2. Resets & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1.5rem;
}

.text-uppercase-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 0.75rem;
    display: block;
}

/* ==========================================================================
   4. Layout Structure
   ========================================================================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    flex: 1;
    padding: 3rem 0;
}

/* Grid Layouts */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Layout with Sidebar */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .layout-with-sidebar {
        grid-template-columns: 2fr 1fr;
    }
}

/* ==========================================================================
   5. Header & Navigation
   ========================================================================== */
.site-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.site-branding {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
}

.site-branding a {
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.custom-logo-link {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.custom-logo-link:hover {
    opacity: 0.95;
}

.custom-logo {
    height: 54px !important;
    max-height: 54px !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

@media (max-width: 768px) {
    .custom-logo {
        height: 44px !important;
        max-height: 44px !important;
        width: auto !important;
    }
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-navigation a {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--accent);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none; /* Will be toggled by JS */
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
        box-shadow: var(--shadow-md);
    }
    
    .main-navigation.is-active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 1.25rem;
    }
}

/* ==========================================================================
   6. Homepage Grid (Featured + List)
   ========================================================================== */
.featured-post-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .featured-post-card {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
    }
}

.featured-image-wrapper {
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.featured-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/10;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-image-wrapper:hover img {
    transform: scale(1.03);
}

.post-card {
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.post-card-meta a {
    color: var(--text-secondary);
}

.post-card-title {
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.featured-post-card .post-card-title {
    font-size: 2.25rem;
}

.post-card-excerpt {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    align-self: flex-start;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2px;
}

.read-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================================
   7. Single Post Page Structure
   ========================================================================== */
.breadcrumbs {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs span.separator::after {
    content: "/";
    margin-left: 0.5rem;
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-header-title {
    font-size: 2.75rem;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    .post-header-title {
        font-size: 2rem;
    }
}

.post-meta-details {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 0;
}

.author-avatar {
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.post-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-primary);
}

.post-content p {
    margin-bottom: 1.75rem;
}

.post-content h2, 
.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.post-content blockquote {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-style: italic;
    color: var(--accent);
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
}

/* Tags & Author Bio */
.post-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.post-tags {
    margin-bottom: 2rem;
}

.post-tags a {
    display: inline-block;
    background-color: var(--bg-secondary);
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

.post-tags a:hover {
    background-color: var(--accent);
    color: #fff;
}

.author-bio-card {
    display: flex;
    gap: 1.5rem;
    background-color: var(--bg-secondary);
    padding: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 576px) {
    .author-bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.author-bio-avatar {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.author-bio-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.author-bio-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Post Navigation */
.post-navigation-links {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 3rem;
}

.nav-link-card {
    flex: 1;
    max-width: 48%;
}

.nav-link-card.next {
    text-align: right;
}

.nav-link-card span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.nav-link-card h4 {
    font-size: 1.1rem;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   8. Sidebar & Widgets
   ========================================================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.widget {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.widget:last-child {
    border-bottom: none;
}

.widget-title {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

.widget ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.widget li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.widget li a {
    color: var(--text-secondary);
}

.widget li a:hover {
    color: var(--accent);
}

/* ==========================================================================
   9. AdSense & Ads Styling
   ========================================================================== */
.ad-slot-wrapper {
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    clear: both;
}

.ad-slot-wrapper::before {
    content: 'Advertisement';
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.ad-header-slot {
    margin: 1.5rem 0;
}

.ad-footer-slot {
    margin: 3rem 0 0 0;
}

.ad-sidebar-slot {
    padding: 1rem;
    min-height: 250px;
}

/* ==========================================================================
   10. Comments Section
   ========================================================================== */
.comments-area {
    margin-top: 3rem;
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.comment-body {
    display: flex;
    gap: 1.25rem;
}

@media (max-width: 576px) {
    .comment-body {
        flex-direction: column;
    }
}

.comment-avatar img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.comment-meta {
    margin-bottom: 0.5rem;
}

.comment-author-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.comment-metadata {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.comment-content {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.reply-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
}

/* Comment Form */
.comment-respond {
    margin-top: 3rem;
}

.comment-reply-title {
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.comment-form label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent);
}

.comment-form input[type="submit"] {
    align-self: flex-start;
    background-color: var(--bg-dark);
    color: #fff;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-form input[type="submit"]:hover {
    background-color: var(--accent);
}

/* ==========================================================================
   11. Footer Section
   ========================================================================== */
.site-footer {
    background-color: var(--bg-dark);
    color: #a0a5ad;
    padding: 6rem 0 3rem 0;
    font-size: 0.9rem;
    border-top: 4px solid var(--accent);
}

.footer-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 4rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .footer-widgets {
        grid-template-columns: 1.5fr 1fr 1.2fr;
    }
}

.footer-widget-title {
    color: #fff;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    margin-bottom: 1.75rem;
}

.footer-widgets p {
    line-height: 1.75;
}

.footer-widgets ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.footer-widgets a {
    color: #a0a5ad;
    position: relative;
    padding-left: 12px;
    transition: color 0.2s, padding-left 0.2s;
}

.footer-widgets a::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateX(-5px);
}

.footer-widgets a:hover {
    color: #ffffff;
    padding-left: 18px;
}

.footer-widgets a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Newsletter styling in footer */
.footer-newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.footer-newsletter-email {
    flex: 1;
    background-color: #1a1c1e;
    border: 1px solid var(--border-dark);
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.footer-newsletter-email:focus {
    border-color: var(--accent);
}

.footer-newsletter-submit {
    background-color: var(--accent);
    color: #fff;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.footer-newsletter-submit:hover {
    background-color: var(--accent-hover);
}

/* Social links in footer */
.footer-social-links {
    display: flex;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.footer-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #1a1c1e;
    color: #a0a5ad;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.875rem;
}

.footer-social-icon:hover {
    background-color: var(--accent);
    color: #ffffff;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.8125rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.copyright-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.copyright-text a {
    color: #fff;
    font-weight: 500;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-bottom-links a {
    color: var(--text-muted);
}

.footer-bottom-links a:hover {
    color: #ffffff;
}

/* ==========================================================================
   12. Utilities & Misc Pages
   ========================================================================== */
.page-header-archive {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 3rem;
}

.page-title-archive {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.archive-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background-color: var(--bg-dark);
    color: #fff;
    border-color: var(--bg-dark);
}

/* Screen Reader Text for Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}
