/* ================================================================
   Design Library — design-library.css
   All dl- prefixed. No global element selectors.
   ================================================================

   Sections:
   1.  Reset / Base
   2.  Layout
   3.  Header
   4.  Hub / Hero
   5.  Filters
   6.  Grid
   7.  Cards
   8.  Single Entry
   9.  Tags
   10. States / Utilities
   ================================================================ */


/* ── 0. TYPOGRAPHY SCALE (mirrors main Lady Learner theme) ── */

:root {
    --text-huge:  2rem;      /* 32px */
    --text-h1:    1.5rem;    /* 24px */
    --text-h2:    1.375rem;  /* 22px */
    --text-h3:    1.25rem;   /* 20px */
    --text-h4:    1.125rem;  /* 18px */
    --text-small: 0.875rem;  /* 14px */
    --text-tiny:  0.75rem;   /* 12px */
    --text-micro: 0.625rem;  /* 10px */
}


/* ── 1. RESET / BASE ─────────────────────────────────────── */

.dl-site *,
.dl-site *::before,
.dl-site *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.dl-site {
    min-height: 100vh;
    background: #fff;
    color: #1a1a1a;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.dl-site a {
    color: inherit;
    text-decoration: none;
}

.dl-site img {
    display: block;
    max-width: 100%;
}

.dl-site button {
    font-family: inherit;
    cursor: pointer;
}


/* ── 2. LAYOUT ───────────────────────────────────────────── */

.dl-main {
    padding: 0 60px 80px;
}

.dl-main--single {
    padding-top: 32px;
}


/* ── 3. HEADER ───────────────────────────────────────────── */

.dl-header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 60px;
    background: #fff;
}

.dl-header__brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dl-header__logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}

.dl-header__logo-img {
    height: 20px;
    width: auto;
}

.dl-header__label {
    font-size: var(--text-small);
    color: #E03140;
    white-space: nowrap;
    font-weight: 600;
    padding-left: 6px;
    border-left: 1px solid #e8d0d2;
    word-spacing: -6%;
}

/* Right action */
.dl-header__action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Center search form */
.dl-header__search-form {
    flex: 0 0 320px;
    display: flex;
    justify-content: center;
}

.dl-header__search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 100px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #ddd;
    width: 100%;
    transition: border-color 0.15s ease;
}

.dl-header__search-wrap:focus-within {
    border-color: #E58191;
}

.dl-header__search-icon {
    color: #999;
    flex-shrink: 0;
    display: flex;
}

.dl-header__search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: var(--text-small);
    flex: 1;
    min-width: 0;
    color: #333;
    font-family: inherit;
}

.dl-header__search-input::placeholder {
    color: #999;
}

.dl-header__search-input::-webkit-search-cancel-button,
.dl-header__search-input::-webkit-search-decoration,
.dl-header__search-input::-webkit-search-results-button,
.dl-header__search-input::-webkit-search-results-decoration {
    display: none;
}

.dl-header__search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    background: #E03140;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dl-header__search-clear:hover {
    background: #E58191;
}

.dl-header__studio-link {
    font-size: var(--text-small);
    color: #2D2B2A;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    transition: color 0.15s ease;
    font-weight: 600;
}

.dl-header__studio-link:hover {
    color: #1a1a1a;
}

.dl-header__studio-arrow {
    font-size: 11px;
    margin-top: -1px;
}


/* ── 4. HUB / HERO ───────────────────────────────────────── */

.dl-hero {
    background: transparent;
    padding: 80px 60px;
    text-align: center;
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

/* Horizontal shape-strip marquee — centered behind hero copy */
.dl-hero-strip {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 148px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: -1;
    background-image: url('shapes.svg');
    background-repeat: repeat-x;
    background-size: 1400px 148px;
    background-position: 0 50%;
    animation: dl-marquee 48s linear infinite;
}

@keyframes dl-marquee {
    from { background-position: 0 50%; }
    to   { background-position: -1400px 50%; }
}

@keyframes dl-marquee-sm {
    from { background-position: 0 50%; }
    to   { background-position: -700px 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .dl-hero-strip {
        animation: none;
    }
}

.dl-hero__headline {
    font-size: var(--text-huge);
    font-weight: 700;
    line-height: 1.55;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.dl-hero__highlight {
    color: #e03535;
}

.dl-hero__title {
    font-size: var(--text-huge);
    font-weight: 700;
    line-height: 1.35;
    color: #e03535;
    letter-spacing: -0.02em;
}

.dl-hero__tagline {
    font-size: var(--text-small);
    color: #888;
    margin-top: 10px;
    line-height: 1.6;
}


/* ── 5. CONTROL BAR / FILTERS ────────────────────────────── */

.dl-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    margin: 10px 0;
    background: #fff;
}

.dl-results-count {
    font-size: var(--text-h3);
    color: #1a1a1a;
    flex-shrink: 0;
    font-weight: 600;
}

.dl-results-count strong {
    font-weight: 600;
    color: #1a1a1a;
}

.dl-control-bar__form {
    display: flex;
    align-items: center;
}

.dl-control-bar__filter-form {
    display: contents;
}


.dl-control-bar__right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Search input inside control bar */
.dl-control-bar__search-form {
    display: flex;
    align-items: center;
}

.dl-control-bar__search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e2e2;
    border-radius: 100px;
    padding: 7px 12px;
    background: #fff;
    transition: border-color 0.15s ease;
}

.dl-control-bar__search-wrap:focus-within {
    border-color: #c0c0c0;
}

.dl-control-bar__search-icon {
    color: #b0b0b0;
    flex-shrink: 0;
    display: flex;
}

.dl-control-bar__search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: var(--text-small);
    width: 140px;
    color: #333;
}

.dl-control-bar__search-input::placeholder {
    color: #bbb;
}

.dl-control-bar__search-input::-webkit-search-cancel-button {
    display: none;
}

.dl-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    background: #ccc;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dl-search-clear:hover {
    background: #999;
}

/* Sort select */
.dl-sort-select {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #ddd;
    border-radius: 100px;
    padding: 7px 28px 7px 12px;
    font-size: var(--text-small);
    font-family: inherit;
    color: #444;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    transition: border-color 0.15s ease;
    white-space: nowrap;
    line-height: 1;
    font-weight: 500;
}

.dl-sort-select:focus {
    outline: none;
    border-color: #aaa;
}

/* Reset button */
.dl-control-bar__reset {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    font-size: var(--text-small);
    color: #e03535;
    border: 1px solid #e03535;
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    transition: background 0.15s ease;
}

.dl-control-bar__reset:hover {
    background: #fff5f5;
}

/* Filter dropdown styles — preserved for filter modal implementation */
.dl-dropdown {
    position: relative;
    display: inline-block;
}

.dl-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 28px 7px 12px;
    font-size: var(--text-small);
    font-family: inherit;
    color: #444;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid #ddd;
    border-radius: 100px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
    line-height: 1;
    font-weight: 500;
}

.dl-dropdown__toggle:hover {
    border-color: #aaa;
}

.dl-dropdown.is-open .dl-dropdown__toggle {
    border-color: #333;
    background-color: #f5f5f5;
}

.dl-dropdown__count {
    color: #e03535;
    font-weight: 600;
}

.dl-dropdown__panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 300;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    padding: 6px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.dl-dropdown.is-open .dl-dropdown__panel {
    display: block;
}

.dl-dropdown__panel fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.dl-dropdown__panel legend {
    display: none;
}

.dl-dropdown__panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: var(--text-small);
    color: #444;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s ease;
}

.dl-dropdown__panel label:hover {
    background: #f7f7f7;
}

.dl-dropdown__panel input[type="checkbox"] {
    flex-shrink: 0;
    accent-color: #e03535;
}

.dl-dropdown__apply {
    display: block;
    width: calc(100% - 28px);
    margin: 6px 14px 8px;
    padding: 7px 0;
    font-size: var(--text-small);
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    background: #E03140;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease;
}

.dl-dropdown__apply:hover {
    background: #c4222f;
}


/* ── 6. GRID ─────────────────────────────────────────────── */

.dl-grid,
.dl-archive__list {
    columns: 2;
    column-gap: 30px;
}

@media (min-width: 961px)  { .dl-grid, .dl-archive__list { columns: 3; } }
@media (min-width: 1281px) { .dl-grid, .dl-archive__list { columns: 4; } }
@media (min-width: 1441px) { .dl-grid, .dl-archive__list { columns: 5; } }
@media (min-width: 1921px) { .dl-grid, .dl-archive__list { columns: 6; } }


/* ── 7. CARDS ────────────────────────────────────────────── */

.dl-card {
    break-inside: avoid;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #efefef;
}

.dl-card__link {
    display: block;
    position: relative;
    line-height: 0;
}

.dl-card__img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.dl-card:hover .dl-card__img {
    transform: scale(1.02);
}

.dl-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.28) 45%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.dl-card:hover .dl-card__overlay {
    opacity: 1;
}

.dl-card__overlay-title {
    font-size: var(--text-small);
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px;
    line-height: 1.35;
}

.dl-card__overlay-subtitle {
    font-size: var(--text-tiny);
    color: rgba(255, 255, 255, 0.76);
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ── 8. SINGLE ENTRY ─────────────────────────────────────── */

.dl-entry-panel {
    display: grid;
    grid-template-columns: 1fr min(480px, 40%);
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    overflow: hidden;
    height: 65vh;
}

/* Left column: image */
.dl-image-area {
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 90px;
}

.dl-image-area__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

/* Back button (top-left) and Source button (top-right) */
.dl-back-btn,
.dl-source-btn {
    position: absolute;
    top: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    z-index: 10;
    transition: background 0.15s ease;
    backdrop-filter: blur(4px);
}

.dl-back-btn  { left: 16px; }
.dl-source-btn { right: 16px; }

.dl-back-btn:hover,
.dl-source-btn:hover {
    background: #fff;
    color: #1a1a1a;
}

/* Right column: metadata */
.dl-meta-panel {
    padding: 40px;
    border-left: 1px solid #e6e6e6;
    overflow-y: auto;
}

.dl-entry__title {
    font-size: var(--text-h1);
    font-weight: 700;
    line-height: 1.35;
    color: #1a1a1a;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

/* Source attribution inside meta panel */
.dl-source {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: var(--text-small);
    color: #999;
    margin-top: 10px;
}

.dl-source .dl-label {
    font-size: var(--text-tiny);
    color: #aaa;
}

.dl-source .dl-label::after {
    content: ':';
}

.dl-source a {
    color: #e03535;
    transition: opacity 0.15s ease;
}

.dl-source a:hover {
    opacity: 0.75;
}

/* Content sections */
.dl-section {
    border-top: 1px solid #f0f0f0;
    padding-top: 30px;
    margin-top: 30px;
}

.dl-section__heading {
    font-size: var(--text-h4);
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.dl-section__info-icon {
    font-size: var(--text-tiny);
    color: #ccc;
    cursor: default;
    font-weight: 400;
}

.dl-section__desc {
    font-size: var(--text-small);
    color: #555;
    line-height: 150%;
    margin-top: 12px;
}

.dl-section__desc p {
    margin-bottom: 8px;
}

.dl-section__desc p:last-child {
    margin-bottom: 0;
}


/* ── 9. TAGS ─────────────────────────────────────────────── */

.dl-tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dl-tag-group--top {
    margin-bottom: 2px;
}

.dl-tag {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-tiny);
    color: #666;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.dl-tag:hover {
    border-color: #999;
    color: #1a1a1a;
}

/* Tag navigation strip below the entry panel */
.dl-tag-nav {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 40px 0;
}

.dl-tag-nav__icon {
    color: #ccc;
    flex-shrink: 0;
    margin-top: 3px;
    display: flex;
    align-items: center;
}

.dl-tag-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Tag navigation items — independent style, larger than metadata chips */
.dl-tag-nav__item {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-small);
    color: #555;
    background: transparent;
    border: 1px solid #d8d8d8;
    border-radius: 100px;
    padding: 6px 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.dl-tag-nav__item:hover {
    border-color: #999;
    color: #1a1a1a;
}


/* ── 10. STATES / UTILITIES ──────────────────────────────── */

.dl-no-results {
    font-size: 15px;
    color: #aaa;
    padding: 60px 0;
    text-align: center;
}

/* ── Tablet and below: ≤960px ───────────────────────── */
@media (max-width: 960px) {

    /* Header: single row — logo left, search right, external links hidden */
    .dl-header {
        padding: 20px 30px;
    }

    .dl-header__action {
        display: none;
    }

    /* Main layout */
    .dl-main {
        padding-left: 30px;
        padding-right: 30px;
    }

    .dl-hero {
        padding-left: 30px;
        padding-right: 30px;
    }

    /* Single entry: stack columns, release fixed viewport height */
    .dl-entry-panel {
        grid-template-columns: 1fr;
        height: auto;
    }

    .dl-image-area {
        min-height: 280px;
    }

    .dl-meta-panel {
        border-left: none;
        border-top: 1px solid #e6e6e6;
        overflow-y: visible;
    }
}

/* ── Mobile: ≤640px ──────────────────────────────────── */
@media (max-width: 640px) {

    /* Header: two rows — logo centered on row 1, search bar full-width on row 2 */
    .dl-header {
        flex-wrap: wrap;
        padding: 16px 20px;
        gap: 10px;
    }

    .dl-header__brand {
        flex: 0 0 100%;
        justify-content: center;
    }

    .dl-header__search-form {
        flex: 0 0 100%;
    }

    /* Archive grid: tighter spacing on mobile */
    .dl-grid,
    .dl-archive__list {
        column-gap: 20px;
    }

    .dl-card {
        margin-bottom: 20px;
    }

    /* Main layout */
    .dl-main {
        padding-left: 20px;
        padding-right: 20px;
    }

    .dl-main--single {
        padding-top: 0;
    }

    /* Hero */
    .dl-hero {
        padding: 40px 20px 36px;
    }

    .dl-hero__headline {
        font-size: var(--text-h2);
    }

    /* Hero strip: render at half size — same speed, smaller footprint */
    .dl-hero-strip {
        height: 74px;
        background-size: 700px 74px;
        animation: dl-marquee-sm 24s linear infinite;
    }

    /* Single entry: pull panel to screen edges, remove card container feel */
    .dl-entry-panel {
        border: none;
        border-radius: 0;
        margin-left: -20px;
        margin-right: -20px;
        padding:20px 20px 0;
    }

    .dl-image-area {
        padding: 0;
    }

    .dl-meta-panel {
        padding: 30px 0;
        border-top: none;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Navigation buttons: hidden on mobile */
    .dl-back-btn,
    .dl-source-btn {
        display: none;
    }

    /* Control bar: hide result count, center remaining filter controls */
    .dl-results-count {
        display: none;
    }

    .dl-control-bar {
        justify-content: center;
    }

    /* Hero: compact typography on mobile */
    .dl-hero__title {
        font-size: var(--text-h2);
    }

    .dl-hero__tagline {
        font-size: var(--text-tiny);
    }
}
