/**
 * Category Archive Styles
 * Loads only on category archive pages.
 *
 * Category uses the same container structure as the homepage (no full-width-content).
 * The #page container constrains width; no custom rail overrides needed.
 */

.dfl-category {
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Desktop: two columns, main + sticky sidebar */
@media (min-width: 1025px) {
    .dfl-category__wrap {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(280px, 340px);
        gap: 40px;
        align-items: start;
    }

    .dfl-category__main {
        min-width: 0;
    }

    .dfl-category__sidebar {
        position: sticky;
        top: 24px;
        /* Align sidebar top with first card (below title + list margin) */
        margin-top: calc(1.2 * clamp(20px, 2.5vw, 26px) + 24px);
    }

    /* Single posts: align sidebar with top stack (category/title/meta) */
    body.single .dfl-category__sidebar {
        top: 92px;
        margin-top: 0;
    }
}

/* Tablet (769–1024px): two columns, industry-standard proportions */
/* Reduce sidebar width, tighten padding, increase content dominance, reduce density, smaller sidebar fonts */
@media (max-width: 1024px) and (min-width: 769px) {
    .dfl-category__wrap {
        display: grid;
        grid-template-columns: minmax(0, 2.5fr) minmax(200px, 260px);
        gap: 20px;
        align-items: start;
    }

    .dfl-category__main {
        min-width: 0;
    }

    .dfl-category__sidebar {
        position: sticky;
        top: 24px;
        margin-top: calc(1.2 * clamp(20px, 2.5vw, 26px) + 24px);
    }

    /* Single posts: align sidebar with top stack (category/title/meta) */
    body.single .dfl-category__sidebar {
        top: 92px;
        margin-top: 0;
    }

    .dfl-category__sidebar .dfl-sidebar__block {
        padding: 12px 0;
    }

    /* Slightly reduce sidebar font sizes */
    .dfl-category__sidebar .dfl-sidebar__heading {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .dfl-category__sidebar .dfl-sidebar__text {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .dfl-category__sidebar .dfl-sidebar__text--note {
        font-size: 12px;
    }

    .dfl-category__sidebar .dfl-sidebar__listLink {
        font-size: 13px;
    }

    .dfl-category__sidebar .dfl-sidebar__meta,
    .dfl-category__sidebar .dfl-sidebar__by,
    .dfl-category__sidebar .dfl-sidebar__date {
        font-size: 13px;
    }

    .dfl-category__sidebar .dfl-sidebar__authorName {
        font-size: 14px;
    }

    .dfl-category__sidebar .dfl-sidebar__viewBadge {
        font-size: 12px;
    }

    .dfl-category__sidebar .dfl-sidebar__viewBadge svg {
        width: 12px;
        height: 12px;
    }

    .dfl-category__sidebar .dfl-sidebar__btn {
        font-size: 13px;
        padding: 8px 16px;
    }

    .dfl-category__sidebar .dfl-sidebar__input {
        font-size: 13px;
        padding: 8px 10px;
    }

    /* Reduce WOAR list item spacing (widget density) */
    .dfl-category__sidebar .dfl-sidebar__listItem {
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
}

/* Tablet + Mobile: edge gaps, padding */
@media (max-width: 1024px) {
    /* Align header with post cards (category content sits inside GP wrappers with extra padding) */
    body.category .site-header .inside-header,
    body.single .site-header .inside-header {
        padding-left: calc(var(--dfl-rail-pad) + 20px);
        padding-right: calc(var(--dfl-rail-pad) + 20px);
    }

    .dfl-category {
        padding-left: var(--dfl-rail-pad);
        padding-right: var(--dfl-rail-pad);
    }
}

/* Mobile (≤768px): single column, sidebar below main */
/* Same industry-standard adjustments: tighten padding, reduce density, smaller sidebar fonts */
@media (max-width: 768px) {
    .dfl-category__title {
        font-size: 14px;
        padding: 10px 20px;
    }

    .dfl-category__wrap {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .dfl-category__sidebar {
        order: 2;
        position: static;
        margin-top: 0;
    }

    .dfl-category__sidebar .dfl-sidebar__block {
        padding: 10px 0;
    }

    /* Slightly reduce sidebar font sizes */
    .dfl-category__sidebar .dfl-sidebar__heading {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .dfl-category__sidebar .dfl-sidebar__text {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .dfl-category__sidebar .dfl-sidebar__text--note {
        font-size: 12px;
    }

    .dfl-category__sidebar .dfl-sidebar__listLink {
        font-size: 13px;
    }

    .dfl-category__sidebar .dfl-sidebar__meta,
    .dfl-category__sidebar .dfl-sidebar__by,
    .dfl-category__sidebar .dfl-sidebar__date {
        font-size: 12px;
    }

    .dfl-category__sidebar .dfl-sidebar__authorName {
        font-size: 13px;
    }

    .dfl-category__sidebar .dfl-sidebar__viewBadge {
        font-size: 11px;
    }

    .dfl-category__sidebar .dfl-sidebar__viewBadge svg {
        width: 11px;
        height: 11px;
    }

    .dfl-category__sidebar .dfl-sidebar__btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    .dfl-category__sidebar .dfl-sidebar__input {
        font-size: 13px;
        padding: 8px 10px;
    }

    /* Reduce WOAR list item spacing (widget density) */
    .dfl-category__sidebar .dfl-sidebar__listItem {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .dfl-category__sidebar .dfl-sidebar__form {
        gap: 12px;
    }

    .dfl-category__sidebar .dfl-sidebar__newsletter,
    .dfl-category__sidebar .dfl-sidebar__membership,
    .dfl-category__sidebar .dfl-sidebar__about {
        text-align: center;
        padding: 14px 0;
    }

    .dfl-category__sidebar .dfl-sidebar__newsletter .dfl-sidebar__heading,
    .dfl-category__sidebar .dfl-sidebar__membership .dfl-sidebar__heading,
    .dfl-category__sidebar .dfl-sidebar__about .dfl-sidebar__heading {
        margin-bottom: 14px;
    }

    .dfl-category__sidebar .dfl-sidebar__newsletter .dfl-sidebar__text,
    .dfl-category__sidebar .dfl-sidebar__membership .dfl-sidebar__text,
    .dfl-category__sidebar .dfl-sidebar__about .dfl-sidebar__text {
        margin-bottom: 16px;
    }

    .dfl-category__sidebar .dfl-sidebar__newsletter .dfl-sidebar__form {
        align-items: center;
        gap: 16px;
    }

    .dfl-category__sidebar .dfl-sidebar__newsletter .dfl-sidebar__btn--submit {
        align-self: center;
    }

    .dfl-category__sidebar .dfl-sidebar__newsletter .dfl-sidebar__input {
        text-align: center;
    }

    .dfl-category__sidebar .dfl-sidebar__newsletter .dfl-sidebar__text--note {
        margin-top: 4px;
    }

    .dfl-category__sidebar .dfl-sidebar__membership .dfl-sidebar__btn {
        margin-top: 4px;
    }
}

/* Category title: pill design (scaled from .dfl-pill for larger font) */
.dfl-category__title {
    margin: 0;
    display: inline-block;
    padding: 12px 24px;
    border-radius: 10px;
    background: var(--dfl-blue);
    border: 1px solid #000;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.dfl-category__title--exclusive {
    background: var(--dfl-red);
}

.dfl-category__list {
    margin-top: 20px;
}

.dfl-category__empty {
    margin: 24px 0 0;
    color: var(--dfl-dark);
    font-size: 17px;
}

.dfl-category__loadMoreWrap {
    margin-top: 22px;
    margin-bottom: 32px;
}

/* Post card stack: tighter spacing (category-specific overrides) */
.dfl-category__list.dfl-latest__list {
    gap: 22px;
}

.dfl-category .dfl-latest__item {
    padding-top: clamp(10px, 1.5vw, 18px);
    padding-bottom: clamp(10px, 1.5vw, 18px);
    padding-left: clamp(16px, 2vw, 24px);
    padding-right: clamp(16px, 2vw, 24px);
}

.dfl-category .dfl-latest__excerpt {
    margin-top: 7px;
}

.dfl-category .dfl-latest__meta {
    margin-top: 8px;
}

/* Sidebar blocks: 20–24px between modules */
.dfl-sidebar__block {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dfl-sidebar__block:last-child {
    border-bottom: none;
}

/* WOAR: lighter, engagement support */
.dfl-sidebar__reading {
    padding: 10px 0;
}

.dfl-sidebar__reading .dfl-sidebar__heading {
    font-size: 16px;
}

.dfl-sidebar__heading {
    margin: 0 0 10px;
    font-family: var(--dfl-heading-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--dfl-blue);
}

.dfl-sidebar__text {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dfl-dark);
}

.dfl-sidebar__text--note {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.85;
}

.dfl-sidebar__btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--dfl-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dfl-sidebar__btn:hover {
    background: var(--dfl-red);
    color: #fff;
}

/* What Others Are Reading list */
.dfl-sidebar__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dfl-sidebar__listItem {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dfl-sidebar__listItem:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dfl-sidebar__listLink {
    display: block;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.25;
    color: var(--dfl-dark);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dfl-sidebar__listLink:hover {
    color: var(--dfl-accent);
    text-decoration: underline;
}

.dfl-sidebar__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.2;
}

.dfl-sidebar__by {
    color: var(--dfl-dark);
    opacity: 0.85;
    font-weight: 500;
}

.dfl-sidebar__authorName {
    color: var(--dfl-accent);
    font-weight: 600;
    font-size: 15px;
}

.dfl-sidebar__date {
    color: var(--dfl-dark);
    opacity: 0.7;
    font-weight: 400;
    margin-left: 4px;
}

.dfl-sidebar__viewBadge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--dfl-dark);
    opacity: 0.85;
    margin-left: auto;
}

.dfl-sidebar__viewBadge svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.dfl-sidebar__empty {
    margin: 0;
    font-size: 14px;
    color: var(--dfl-dark);
    opacity: 0.6;
}

/* Newsletter form: tighter input–button gap */
.dfl-sidebar__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dfl-sidebar__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--dfl-dark);
}

.dfl-sidebar__input {
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--dfl-blue) !important;
    border-radius: 6px;
    outline: none;
}

.dfl-sidebar__input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.dfl-sidebar__btn--submit {
    align-self: flex-start;
    font-weight: 600;
}

/* Newsletter: tighter vertical padding, efficient block */
.dfl-sidebar__newsletter {
    padding: 10px 0;
}

.dfl-sidebar__newsletter .dfl-sidebar__text {
    margin-bottom: 10px;
}

.dfl-sidebar__newsletter .dfl-sidebar__heading {
    margin-bottom: 8px;
}

/* Membership: revenue-driven, more authority than newsletter */
.dfl-sidebar__membership {
    padding: 16px 0;
}

.dfl-sidebar__membership .dfl-sidebar__heading {
    margin-bottom: 10px;
}

.dfl-sidebar__membership .dfl-sidebar__text {
    margin-bottom: 12px;
}

.dfl-sidebar__membership .dfl-sidebar__btn {
    font-weight: 700;
}

/* About: supporting content, lighter */
.dfl-sidebar__about {
    padding: 10px 0;
}

.dfl-sidebar__about .dfl-sidebar__text {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 0;
}

.dfl-sidebar__about .dfl-sidebar__heading {
    margin-bottom: 8px;
}
