/* ==========================================================================
   FT Emerald — Homepage Sidebar Layout
   Auto-enqueued by inc/homepage-sidebar.php
   ========================================================================== */


/* ─── Homepage Grid: Content + Sidebar ─── */

.homepage-layout {
    display: grid !important;
    grid-template-columns: 1fr 320px !important;
    gap: 40px !important;
    align-items: start !important;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 20px;
}

.homepage-main {
    min-width: 0;
}

.homepage-sidebar {
    padding-top: 1.5em;
}

/* Sticky sidebar */
.sidebar-sticky-wrap {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ccc1b7 transparent;
}

.sidebar-sticky-wrap::-webkit-scrollbar {
    width: 4px;
}
.sidebar-sticky-wrap::-webkit-scrollbar-thumb {
    background: #ccc1b7;
    border-radius: 2px;
}

body.admin-bar .sidebar-sticky-wrap {
    top: 112px;
    max-height: calc(100vh - 132px);
}

/* Force 2-col in main when sidebar present */
.homepage-main .posts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}


/* ─── Responsive ─── */

@media (max-width: 1023px) {
    .homepage-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .homepage-sidebar {
        border-top: 2px solid #ccc1b7;
        padding-top: 1.5em;
    }

    .sidebar-sticky-wrap {
        position: static;
        max-height: none;
        overflow-y: visible;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .homepage-main .posts-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 599px) {
    .sidebar-sticky-wrap {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   REPORT WIDGETS
   ========================================================================== */

.sidebar-report-widget {
    background: #faf5ef;
    border-left: 3px solid var(--report-color, #0b6b4f);
    border-radius: 0 4px 4px 0;
    padding: 1em 1.125em;
    margin-bottom: 1.25em;
    transition: box-shadow 0.2s ease;
    box-sizing: border-box;
}

.sidebar-report-widget:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Header */
.sidebar-report-widget__header {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
    padding-bottom: 0.625em;
    border-bottom: 1px solid #ccc1b7;
}

.sidebar-report-widget__icon {
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-report-widget__title {
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--report-color, #0b6b4f);
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    flex: 1;
    line-height: 1.3;
}

.sidebar-report-widget__badge {
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    background: var(--report-color, #0b6b4f);
    padding: 0.2em 0.55em;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}

/* Post list */
.sidebar-report-widget__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar-report-widget__list li {
    border-bottom: 1px solid #f2dfce;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar-report-widget__list li:last-child {
    border-bottom: none;
}

.sidebar-report-widget__list a {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5em;
    padding: 0.5em 0.5em;
    text-decoration: none !important;
    border-radius: 2px;
    transition: background 0.15s ease;
}

.sidebar-report-widget__list a:hover {
    background: #f0e0d0;
    text-decoration: none !important;
}

.sidebar-report-widget__post-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    flex: 1;
}

.sidebar-report-widget__list a:hover .sidebar-report-widget__post-title {
    color: var(--report-color, #0b6b4f);
}

.sidebar-report-widget__post-date {
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.6875rem;
    color: #9e9893;
    white-space: nowrap;
    margin-top: 2px;
}

/* Archive link */
.sidebar-report-widget__archive-link {
    display: block;
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--report-color, #0b6b4f);
    text-decoration: none;
    margin-top: 0.625em;
    padding-top: 0.5em;
    border-top: 1px solid #ccc1b7;
}

.sidebar-report-widget__archive-link:hover {
    color: #1a1a1a;
    text-decoration: none;
}


/* ==========================================================================
   AD SLOTS
   ========================================================================== */

.sidebar-ad-slot {
    margin-bottom: 1.25em;
    text-align: center;
}

.sidebar-ad-slot::before {
    content: 'Advertisement';
    display: block;
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9e9893;
    margin-bottom: 0.375em;
    text-align: center;
}

.sidebar-ad-slot .ad-widget {
    display: flex;
    justify-content: center;
}

.sidebar-ad-slot .ad-widget img {
    max-width: 100%;
    height: auto;
}

/* Placeholder boxes */
.sidebar-ad-placeholder {
    background: #f0e0d0;
    border: 2px dashed #ccc1b7;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9e9893;
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    gap: 0.25em;
    padding: 1.5em;
    box-sizing: border-box;
    margin: 0 auto;
}

.sidebar-ad-placeholder[data-size="300x250"] {
    width: 300px;
    height: 250px;
    max-width: 100%;
}

.sidebar-ad-placeholder[data-size="300x600"] {
    width: 300px;
    height: 600px;
    max-width: 100%;
}

.sidebar-ad-placeholder span {
    font-size: 0.875rem;
    font-weight: 600;
}

.sidebar-ad-placeholder small {
    font-size: 0.75rem;
    opacity: 0.6;
}


/* ==========================================================================
   NEWSLETTER WIDGET
   ========================================================================== */

.sidebar-newsletter-widget {
    background: #0b6b4f;
    color: #fff;
    padding: 1.25em;
    border-radius: 4px;
    margin-bottom: 1.25em;
}

.sidebar-newsletter-widget .widget-title {
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.sidebar-newsletter-widget p {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-newsletter-widget input[type="email"],
.sidebar-newsletter-widget input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 0.5em 0.75em;
    border-radius: 2px;
    margin-bottom: 0.5em;
}

.sidebar-newsletter-widget input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-newsletter-widget input[type="submit"],
.sidebar-newsletter-widget button {
    width: 100%;
    background: #fff;
    color: #0b6b4f;
    font-weight: 700;
    border: none;
    padding: 0.625em;
    cursor: pointer;
}


/* ==========================================================================
   GENERAL SIDEBAR WIDGETS
   ========================================================================== */

.homepage-sidebar .sidebar-widget {
    margin-bottom: 1.25em;
    padding-bottom: 1.25em;
    border-bottom: 1px solid #ccc1b7;
}

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

.homepage-sidebar .widget-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0b6b4f;
    border-bottom: 2px solid #0b6b4f;
    padding-bottom: 0.4em;
    margin-bottom: 0.75em;
}

.homepage-sidebar .widget ul {
    list-style: none;
    padding: 0;
}

.homepage-sidebar .widget li {
    padding: 0.35em 0;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8125rem;
    border-bottom: 1px solid #f2dfce;
}

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

.homepage-sidebar .widget li a {
    color: #33302e;
    text-decoration: none;
}

.homepage-sidebar .widget li a:hover {
    color: #0b6b4f;
}


/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .homepage-sidebar,
    .sidebar-ad-slot {
        display: none !important;
    }
    .homepage-layout {
        grid-template-columns: 1fr !important;
    }
}
