/* ============================================================
   LocalDeals Theme — Main Stylesheet
   Design system driven by CSS variables from admin settings.
   All variable values injected via functions.php at runtime.
   ============================================================ */

/* ── BASE RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── BODY ───────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
.ld-section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    white-space: nowrap;
}

/* ── LAYOUT CONTAINERS ──────────────────────────────────── */
.ld-section-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ld-section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── HEADER ─────────────────────────────────────────────── */
.ld-header {
    background: var(--ink);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}

.ld-header__inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ld-logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    letter-spacing: -0.02em;
}
.ld-logo-text span { color: var(--accent); }

.ld-header__nav { margin-left: auto; }

.ld-nav__list {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.ld-nav__list a {
    font-size: 0.85rem;
    color: #bbb;
    transition: color 0.2s;
}
.ld-nav__list a:hover { color: #fff; }

.ld-header__right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.ld-header__date {
    font-size: 0.7rem;
    color: #666;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ld-header__mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}
.ld-header__mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.2s;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.ld-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
}

.ld-btn--advertise {
    background: var(--accent);
    color: #fff;
    padding: 0.45rem 1.1rem;
    border-radius: 6px;
    font-size: 0.8rem;
}
.ld-btn--advertise:hover { opacity: 0.85; }

.ld-btn--cta {
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
}
.ld-btn--cta:hover { transform: translateY(-1px); }

/* ── THEME STRIP ─────────────────────────────────────────── */
.ld-theme-strip {
    background: var(--accent2);
    padding: 0.55rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ld-theme-strip__label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
}

.ld-theme-strip__tag {
    background: var(--ink);
    color: var(--accent2);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.ld-theme-strip__slots {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--ink);
    opacity: 0.7;
}

.ld-theme-strip__cta {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    background: rgba(0,0,0,0.1);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    transition: background 0.2s;
}
.ld-theme-strip__cta:hover { background: rgba(0,0,0,0.2); }

/* ── SPONSOR CARD ────────────────────────────────────────── */
.ld-sponsor-wrap {
    padding: 1.5rem 2rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.ld-sponsor-card {
    background: var(--sponsor-bg);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.ld-sponsor-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: 220px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,77,28,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.ld-sponsor-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255,255,255,0.08);
    color: #888;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

.ld-sponsor-card__eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ld-sponsor-card__headline {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.75rem;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.ld-sponsor-card__sub {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.ld-sponsor-card__logo-block {
    text-align: center;
    min-width: 140px;
}

.ld-sponsor-logo { max-width: 120px; margin: 0 auto 0.5rem; border-radius: 12px; }

.ld-sponsor-logo-placeholder {
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.07);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: #555;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    margin: 0 auto 0.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.ld-sponsor-biz-name {
    font-size: 0.75rem;
    color: #666;
}

/* ── NEWS DIGEST ─────────────────────────────────────────── */
.ld-news-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.75rem 2rem 0;
}

.ld-news-strip {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ld-news-item {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.9rem;
    align-items: center;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.ld-news-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.ld-news-thumb {
    width: 72px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    text-decoration: none;
}

.ld-news-content {
    padding: 0.6rem 0.75rem 0.6rem 0;
    min-width: 0;
}

.ld-news-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.ld-news-source {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.ld-news-age {
    font-size: 0.62rem;
    color: var(--muted);
}

.ld-news-headline-link { display: block; }

.ld-news-headline {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}
.ld-news-headline-link:hover .ld-news-headline { color: var(--accent); }

.ld-news-summary {
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.45;
    margin-top: 0.12rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── DEALS SECTION ───────────────────────────────────────── */
.ld-deals-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
}

/* ── DEALS GRID ──────────────────────────────────────────── */
.ld-deals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    padding-bottom: 2rem;
}

/* ── DEAL CARD — BASE ────────────────────────────────────── */
.ld-deal-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    border: 1px solid var(--border);
    height: var(--card-height);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.ld-deal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

/* ── CARD IMAGE ──────────────────────────────────────────── */
.ld-card__image {
    height: var(--img-height);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warm);
}

.ld-card__image--badge::after {
    content: 'Deal';
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}

.ld-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ld-card__image-placeholder {
    font-size: 2.5rem;
    line-height: 1;
}

/* ── CARD BODY ───────────────────────────────────────────── */
.ld-card__body {
    padding: var(--body-pad);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.ld-card__biz-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.ld-card__logo {
    width: var(--logo-size);
    height: var(--logo-size);
    border-radius: 5px;
    background: var(--warm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: calc(var(--logo-size) * 0.45);
    color: var(--muted);
    flex-shrink: 0;
}

.ld-card__biz-name {
    font-size: var(--biz-size);
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ld-card__headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--hl-size);
    color: var(--ink);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.ld-card__desc {
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

/* ── CARD CTA ────────────────────────────────────────────── */
.ld-card__cta {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--cta-size);
    letter-spacing: 0.04em;
    padding: 0.28rem 0.7rem;
    border-radius: var(--cta-radius);
    transition: all 0.15s;
    cursor: pointer;
    white-space: nowrap;
    align-self: flex-start;
}

.ld-cta-outline {
    border: 1.5px solid var(--ink);
    color: var(--ink);
    background: transparent;
}
.ld-cta-outline:hover { background: var(--ink); color: #fff; }

.ld-cta-filled {
    background: var(--accent);
    color: #fff;
    border: none;
}
.ld-cta-filled:hover { opacity: 0.85; }

.ld-cta-soft {
    background: var(--warm);
    color: var(--ink);
    border: 1px solid var(--border);
}
.ld-cta-soft:hover { background: var(--border); }

/* ── CTA + URL ROW ───────────────────────────────────────── */
.ld-card__cta-url-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* ── DISPLAY URL ─────────────────────────────────────────── */
.ld-card__display-url {
    font-size: 0.58rem;
    color: var(--muted);
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.ld-card__display-url::before {
    content: '🔗';
    font-size: 0.5rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.ld-url--below { margin-top: 0.25rem; }
.ld-url--biz-row { margin-left: auto; }

.ld-card__url-footer {
    padding: 0.35rem var(--body-pad);
    border-top: 1px solid var(--border);
    background: var(--warm);
}
.ld-url--footer { font-size: 0.6rem; }

/* ── CARD STYLE VARIANTS ─────────────────────────────────── */

/* Style B: Horizontal */
.ld-card-style-b {
    flex-direction: row;
    height: 110px;
}
.ld-card-style-b .ld-card__image {
    width: 110px;
    height: 100%;
    flex-shrink: 0;
}

/* Style C: Minimal — no image */
.ld-card-style-c {
    padding: 1rem;
    height: auto;
    min-height: 180px;
}
.ld-card-style-c::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}
.ld-card-style-c .ld-card__image { display: none; }
.ld-card-style-c .ld-card__body {
    padding: 0;
    justify-content: space-between;
}

/* Style D: Editorial overlay */
.ld-card-style-d .ld-card__image {
    position: absolute;
    inset: 0;
    height: 100%;
    z-index: 0;
}
.ld-card-style-d .ld-card__body {
    position: absolute;
    inset: 0;
    z-index: 1;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
    padding: 1.25rem 1rem 1rem;
}
.ld-card-style-d .ld-card__biz-name { color: rgba(255,255,255,0.6); }
.ld-card-style-d .ld-card__headline { color: #fff; }
.ld-card-style-d .ld-card__cta { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }

/* Style E: Accent stripe */
.ld-card-style-e {
    flex-direction: row;
}
.ld-card__stripe {
    width: 6px;
    background: var(--accent);
    flex-shrink: 0;
}
.ld-card-style-e .ld-card__image {
    width: 90px;
    height: 100%;
    flex-shrink: 0;
}

/* ── EMPTY SLOT CARD ─────────────────────────────────────── */
.ld-deal-card--empty {
    border-style: dashed;
    background: transparent;
    align-items: center;
    justify-content: center;
    height: var(--card-height);
    overflow: visible;
}
.ld-deal-card--empty:hover { border-color: var(--accent); }

.ld-empty-slot__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    width: 100%;
    height: 100%;
    padding: 1rem;
}

.ld-empty-slot__icon {
    font-size: 1.5rem;
    color: var(--border);
    transition: color 0.2s;
}
.ld-deal-card--empty:hover .ld-empty-slot__icon { color: var(--accent); }

.ld-empty-slot__label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ccc;
}

.ld-empty-slot__price {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

/* ── IMAGE TINTS ─────────────────────────────────────────── */
.ld-tint-orange { background: #fff4f0; }
.ld-tint-green  { background: #f0faf4; }
.ld-tint-blue   { background: #f0f4ff; }
.ld-tint-yellow { background: #fffbf0; }
.ld-tint-pink   { background: #fff0f5; }
.ld-tint-warm   { background: var(--warm); }

/* ── FOOTER ──────────────────────────────────────────────── */
.ld-footer {
    background: var(--ink);
    margin-top: 3rem;
}

.ld-footer__inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.ld-footer__brand .ld-logo-text { font-size: 1rem; }

.ld-footer__tagline {
    font-size: 0.72rem;
    color: #666;
    margin-top: 0.3rem;
}

.ld-footer__nav-list {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ld-footer__nav-list a {
    font-size: 0.75rem;
    color: #666;
    transition: color 0.2s;
}
.ld-footer__nav-list a:hover { color: #fff; }

.ld-footer__meta {
    margin-left: auto;
    text-align: right;
}

.ld-footer__copyright,
.ld-footer__powered {
    font-size: 0.68rem;
    color: #555;
}

.ld-footer__powered a { color: #888; }
.ld-footer__powered a:hover { color: #fff; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1200px) {
    .ld-deals-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .ld-deals-grid { grid-template-columns: repeat(2, 1fr); }
    .ld-sponsor-card { grid-template-columns: 1fr; }
    .ld-sponsor-card__logo-block { display: none; }
    .ld-news-item { grid-template-columns: 60px 1fr; }
}

@media (max-width: 600px) {
    .ld-header__nav,
    .ld-header__date { display: none; }
    .ld-header__mobile-toggle { display: flex; }
    .ld-deals-grid { grid-template-columns: 1fr; }
    .ld-sponsor-wrap,
    .ld-news-section,
    .ld-deals-section { padding-left: 1rem; padding-right: 1rem; }
    .ld-header__inner { padding: 0 1rem; }
    .ld-theme-strip { padding: 0.55rem 1rem; }
    .ld-footer__meta { margin-left: 0; text-align: left; }
}
