
/* Footer Styles — colours driven by Customizer vars (Appearance → Customize →
   Footer Settings), with safe dark defaults so it never depends on --hc-secondary. */
.site-footer {
    background-color: var(--hc-footer-bg, #2c3e50);
    color: var(--hc-footer-text, white);
    margin-top: var(--hc-space-20);
}

.footer-widgets {
    padding: var(--hc-space-20) 0 var(--hc-space-16) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-widget-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--hc-space-8);
}

.footer-widget-area {
    color: rgba(255, 255, 255, 0.9);
}

.footer-widget-area .widget-title {
    color: white;
    font-family: var(--hc-font-primary);
    font-size: var(--hc-font-size-xl);
    font-weight: 600;
    margin-bottom: var(--hc-space-6);
    border-bottom: 2px solid var(--hc-primary);
    padding-bottom: var(--hc-space-2);
    display: inline-block;
}

.footer-widget-area .widget {
    margin-bottom: var(--hc-space-8);
}

.footer-widget-area .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget-area .widget ul li {
    margin-bottom: var(--hc-space-2);
    padding-left: var(--hc-space-4);
    position: relative;
}

.footer-widget-area .widget ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--hc-primary);
}

.footer-widget-area .widget a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-widget-area .widget a:hover {
    color: var(--hc-primary);
}

/* Default footer-column lists (Quick Links / Recent Posts) when no widgets. */
.footer-widget-area .footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-widget-area .footer-menu li {
    margin-bottom: 0.5rem;
}
.footer-widget-area .footer-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-widget-area .footer-menu a:hover {
    color: var(--hc-primary);
}

/* Footer Bottom */
.footer-bottom {
    padding: var(--hc-space-8) 0;
    background-color: rgba(0, 0, 0, 0.2);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--hc-space-4);
}

.footer-navigation .footer-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--hc-space-6);
    margin-bottom: var(--hc-space-4);
}

.footer-navigation .footer-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: var(--hc-font-size-sm);
    transition: color 0.3s ease;
}

.footer-navigation .footer-menu a:hover {
    color: var(--hc-primary);
}

.footer-text {
    font-size: var(--hc-font-size-sm);
    color: rgba(255, 255, 255, 0.7);
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: var(--hc-space-3);
    align-items: center;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: var(--hc-font-size-lg);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--hc-primary);
    color: white;
    transform: translateY(-2px);
}

/* Post Grid Styles */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--hc-space-8);
    margin-bottom: var(--hc-space-12);
}

/* A lone post (e.g. a single-post day/category archive) shouldn't stretch
   full-width — cap it to a sensible card width and centre it. */
.posts-grid .post-card:only-child {
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.post-card {
    background: white;
    border-radius: var(--hc-border-radius-lg);
    box-shadow: var(--hc-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hc-shadow-lg);
}

/* Sticky / featured post — must be distinctly recognisable vs normal posts
   (theme-unit-test sticky-post requirement). */
.post-card.sticky {
    position: relative;
    border: 2px solid var(--hc-primary, #c9aa7c);
    box-shadow: 0 10px 30px rgba(201, 170, 124, 0.30);
}
.post-card .featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    background: var(--hc-primary, #c9aa7c);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35em 0.7em;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.post-card .featured-badge::before {
    content: "\2605"; /* star */
    font-size: 0.95em;
    line-height: 1;
}

.post-card .post-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-card .post-content {
    padding: var(--hc-space-6);
}

.post-card .entry-title {
    font-size: var(--hc-font-size-xl);
    margin-bottom: var(--hc-space-3);
}

.post-card .entry-title a {
    color: var(--hc-secondary);
    text-decoration: none;
}

.post-card .entry-title a:hover {
    color: var(--hc-primary);
}

.post-card .entry-meta {
    font-size: var(--hc-font-size-sm);
    color: var(--hc-text-light);
    margin-bottom: var(--hc-space-4);
}

.post-card .entry-summary {
    color: var(--hc-text-light);
    line-height: 1.6;
    margin-bottom: var(--hc-space-6);
}

/* Mobile Menu Styles */
@media (max-width: 767px) {
    .main-navigation {
        display: block; /* override style.css's display:none so the off-canvas panel can show */
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: var(--hc-shadow-xl);
        padding: var(--hc-space-8) var(--hc-space-6);
        /* visibility:hidden removes the CLOSED panel from the tab order and
           accessibility tree (off-screen links must not receive focus). The
           0.3s visibility delay lets the slide-out animation finish first. */
        visibility: hidden;
        transition: left 0.3s ease, visibility 0s linear 0.3s;
        z-index: 9999;
        overflow-y: auto;
    }

    /* Keep the toggle tappable above the open panel/overlay. */
    .mobile-menu-toggle {
        position: relative;
        z-index: 10000;
    }
    
    .main-navigation.mobile-menu-open {
        left: 0;
        visibility: visible;
        transition: left 0.3s ease, visibility 0s linear 0s; /* visible immediately on open */
    }
    
    .mobile-menu-active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        /* Must sit BELOW .site-header (z-index 1000): the nav panel lives
           inside the header's stacking context, so its own z-index can never
           exceed the header's against this root-level overlay. */
        z-index: 999;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding-top: var(--hc-space-8);
    }
    
    .nav-menu li {
        border-bottom: 1px solid var(--hc-border);
    }
    
    .nav-menu a {
        display: block;
        padding: var(--hc-space-4) 0;
        font-size: var(--hc-font-size-lg);
        font-weight: 500;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-navigation .footer-menu {
        flex-direction: column;
        gap: var(--hc-space-3);
    }
    
    .footer-widget-areas {
        grid-template-columns: 1fr;
        gap: var(--hc-space-12);
    }
}

/* Single Post Styles */
.single .site-main {
    padding: var(--hc-space-20) 0;
}

.single .entry-header {
    text-align: center;
    margin-bottom: var(--hc-space-8);
}

.single .entry-title {
    font-size: var(--hc-font-size-4xl);
    line-height: 1.1;
    margin-bottom: var(--hc-space-6);
}

.single .entry-meta {
    color: var(--hc-text-light);
    font-size: var(--hc-font-size-sm);
}

.single .entry-content {
    font-size: var(--hc-font-size-lg);
    line-height: 1.7;
    max-width: 800px;
    margin: 0 auto;
}

.single .entry-content h2,
.single .entry-content h3,
.single .entry-content h4 {
    margin-top: var(--hc-space-12);
    margin-bottom: var(--hc-space-6);
}

.single .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--hc-border-radius);
}

/* Comments */
.comments-area {
    max-width: 800px;
    margin: var(--hc-space-20) auto 0;
    padding-top: var(--hc-space-16);
    border-top: 1px solid var(--hc-border);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    margin-bottom: var(--hc-space-8);
    padding: var(--hc-space-6);
    background: var(--hc-background-alt);
    border-radius: var(--hc-border-radius);
}

.comment-meta {
    font-size: var(--hc-font-size-sm);
    color: var(--hc-text-light);
    margin-bottom: var(--hc-space-4);
}

.comment-content {
    line-height: 1.6;
}

/* Forms */
.form-field {
    margin-bottom: var(--hc-space-6);
}

.form-field label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--hc-space-2);
    color: var(--hc-text);
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: var(--hc-space-3) var(--hc-space-4);
    border: 2px solid var(--hc-border);
    border-radius: var(--hc-border-radius);
    font-family: var(--hc-font-secondary);
    font-size: var(--hc-font-size-base);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--hc-primary);
    box-shadow: 0 0 0 3px rgba(201, 170, 124, 0.1);
}

/* Search Form */
.search-form {
    display: flex;
    gap: var(--hc-space-2);
    max-width: 400px;
}

.search-form .search-field {
    flex: 1;
    border: 2px solid var(--hc-border);
    border-radius: var(--hc-border-radius);
    padding: var(--hc-space-3) var(--hc-space-4);
}

.search-form .search-submit {
    background: var(--hc-primary);
    color: white;
    border: none;
    padding: var(--hc-space-3) var(--hc-space-6);
    border-radius: var(--hc-border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form .search-submit:hover {
    background: var(--hc-primary-dark);
}

/* Accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--hc-background);
    border-radius: var(--hc-border-radius);
    box-shadow: var(--hc-shadow);
    clip: auto !important;
    color: var(--hc-text);
    display: block;
    font-size: var(--hc-font-size-sm);
    font-weight: 600;
    height: auto;
    left: var(--hc-space-2);
    line-height: normal;
    padding: var(--hc-space-3) var(--hc-space-4);
    text-decoration: none;
    top: var(--hc-space-2);
    width: auto;
    z-index: 100000;
}

/* Skip Links */
.skip-link {
    background: var(--hc-primary);
    color: white;
    left: -9999px;
    padding: var(--hc-space-2) var(--hc-space-4);
    position: absolute;
    text-decoration: none;
    top: var(--hc-space-2);
    z-index: 999999;
}

.skip-link:focus {
    left: var(--hc-space-2);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --hc-primary: #000080;
        --hc-secondary: #000000;
        --hc-text: #000000;
        --hc-background: #ffffff;
        --hc-border: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .nav-menu,
    .mobile-menu-toggle,
    .social-icons,
    .btn {
        display: none !important;
    }
    
    .site-main {
        padding: 0 !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000;
    }
    
    img {
        max-width: 100% !important;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}
