/* ==========================================================================
   LM Video Listings - stylesheet
   A warm, editorial media-site look: clean sans-serif, generous whitespace,
   card-based grid with a soft hover lift, single accent color used
   sparingly for links/categories/CTAs.
   ========================================================================== */

:root {
    --lm-ink:        #1a1a1a;
    --lm-ink-soft:   #55534f;
    --lm-bg:         #fdfcfa;
    --lm-card-bg:    #ffffff;
    --lm-border:     #ece8e1;
    --lm-accent:     #e0492b;   /* warm coral-red - LifeMinute-ish energy */
    --lm-accent-ink: #ffffff;
    --lm-shadow:     0 1px 3px rgba(20, 18, 14, 0.06), 0 8px 24px rgba(20, 18, 14, 0.05);
    --lm-shadow-hover: 0 4px 10px rgba(20, 18, 14, 0.08), 0 16px 32px rgba(20, 18, 14, 0.10);
    --lm-radius:     14px;
    --lm-max-width:  1140px;
    --lm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   GLOBAL BRAND PASS
   Targets base HTML elements (not theme-specific classes) so the accent
   color, typography, and link/button styling carry through the theme's
   own header, footer, and widget areas too - not just our custom video
   templates. Kept deliberately light-touch (colors, weight, hover states)
   rather than fighting the theme's layout/spacing, which stays intact.
   ========================================================================== */

html,
body,
#page,
.site,
.hfeed,
.site-content,
.content-area {
    background: var(--lm-bg) !important;
}

body {
    font-family: var(--lm-font);
}

a {
    color: var(--lm-accent);
}

a:hover {
    color: var(--lm-accent);
    opacity: 0.8;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--lm-font);
    letter-spacing: -0.01em;
}

/* Buttons - covers most themes' standard button markup: <button>,
   submit inputs, and the common .button/.btn utility classes */
button:not(.lm-wrap button),
input[type="submit"],
input[type="button"],
.button,
.btn,
.wp-block-button__link {
    background: var(--lm-accent) !important;
    color: var(--lm-accent-ink) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.65rem 1.3rem !important;
    font-weight: 600 !important;
    transition: opacity 0.15s ease;
}

button:not(.lm-wrap button):hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.button:hover,
.btn:hover,
.wp-block-button__link:hover {
    opacity: 0.85 !important;
}

/* Footer area - generic selectors covering most themes' footer wrapper
   naming conventions (site-footer, footer-widget-area, colophon), so
   copyright text, social icons, and footer links pick up the accent
   without needing your specific theme's exact class names confirmed. */
.site-footer a,
footer.site-footer a,
#colophon a,
.footer-widget-area a {
    color: inherit;
}

.site-footer a:hover,
footer.site-footer a:hover,
#colophon a:hover,
.footer-widget-area a:hover {
    color: var(--lm-accent);
}

.site-footer,
footer.site-footer,
#colophon {
    border-top: 1px solid var(--lm-border);
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
    margin-top: 2rem;
}

.site-footer svg,
footer.site-footer svg,
#colophon svg {
    width: 22px !important;
    height: 22px !important;
    transition: opacity 0.15s ease;
}

.site-footer a:hover svg,
footer.site-footer a:hover svg,
#colophon a:hover svg {
    opacity: 0.7;
}

.lm-wrap {
    max-width: var(--lm-max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    font-family: var(--lm-font);
    color: var(--lm-ink);
}

/* ---------- Section headers (used on homepage, one per category) ---------- */

.lm-section {
    margin-bottom: 3.5rem;
}

.lm-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--lm-border);
}

.lm-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.lm-section-title a {
    color: var(--lm-ink);
    text-decoration: none;
}

.lm-section-title a:hover {
    color: var(--lm-accent);
}

.lm-section-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lm-accent);
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lm-section-link:hover {
    text-decoration: underline;
}

/* ---------- Archive/taxonomy page header ---------- */

.lm-archive-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 2rem;
}

/* ---------- Grid + cards ---------- */

.lm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.75rem;
}

.lm-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--lm-card-bg);
    border-radius: var(--lm-radius);
    overflow: hidden;
    box-shadow: var(--lm-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lm-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--lm-shadow-hover);
}

.lm-card-thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f1efe9;
    overflow: hidden;
}

.lm-card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.lm-card:hover .lm-card-thumb-wrap img {
    transform: scale(1.045);
}

.lm-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
    background: linear-gradient(0deg, rgba(0,0,0,0.35), rgba(0,0,0,0));
}

.lm-card:hover .lm-card-play {
    opacity: 1;
}

.lm-card-play svg {
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.lm-card-body {
    padding: 0.9rem 1.05rem 1.1rem;
}

.lm-card-date {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lm-accent);
    margin: 0 0 0.35rem;
}

.lm-card-title {
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
    margin: 0;
    color: var(--lm-ink);
}

/* ---------- Pagination ---------- */
/* Targets WordPress's actual the_posts_pagination() markup
   (.page-numbers, .current, .dots, .next/.prev) directly, with enough
   specificity to override the active theme's own pagination styling. */

.lm-pagination {
    margin-top: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    background: var(--lm-card-bg);
    padding: 1.25rem 1.5rem;
    border-radius: var(--lm-radius);
    box-shadow: var(--lm-shadow);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.lm-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.lm-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--lm-border);
    text-decoration: none;
    color: var(--lm-ink) !important;
    background: var(--lm-card-bg);
    font-size: 0.9rem;
    font-weight: 600;
    box-sizing: border-box;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

a.lm-pagination .page-numbers,
.lm-pagination a.page-numbers {
    color: var(--lm-ink) !important;
}

.lm-pagination a.page-numbers:hover {
    border-color: var(--lm-accent) !important;
    color: var(--lm-accent) !important;
    background: var(--lm-card-bg) !important;
}

.lm-pagination .page-numbers.current {
    background: var(--lm-accent) !important;
    border-color: var(--lm-accent) !important;
    color: var(--lm-accent-ink) !important;
}

.lm-pagination .page-numbers.dots {
    border: none;
    background: none;
    color: var(--lm-ink-soft) !important;
}

/* ---------- Single video page ---------- */

.lm-single {
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
    font-family: var(--lm-font);
    color: var(--lm-ink);
}

.lm-single-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

.lm-single-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--lm-ink-soft);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.lm-single-meta .lm-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--lm-ink-soft);
    display: inline-block;
}

.lm-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--lm-radius);
    overflow: hidden;
    box-shadow: var(--lm-shadow);
    margin-bottom: 2rem;
    background: #111;
}

.lm-embed iframe,
.lm-embed video,
.lm-embed img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

.lm-no-match {
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    background: #fbf2ef;
    border: 1px solid #f2d9d0;
    color: #8a3620;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.lm-single-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--lm-ink);
}

.lm-single-content p {
    margin: 0 0 1.25rem;
}

.lm-single-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--lm-border);
    font-size: 0.9rem;
    color: var(--lm-ink-soft);
}

.lm-single-footer a {
    color: var(--lm-accent);
    text-decoration: none;
    font-weight: 600;
}

.lm-single-footer a:hover {
    text-decoration: underline;
}

/* ---------- Empty state ---------- */

.lm-empty {
    color: var(--lm-ink-soft);
    font-size: 0.95rem;
    padding: 2rem 0;
}

/* ---------- Mobile: homepage category previews show 1 item, not 4 ---------- */
/* (only .lm-grid-preview, used on front-page.php - the full taxonomy
   archive grid keeps its normal multi-column/stacked behavior) */

@media (max-width: 640px) {
    .lm-grid-preview {
        grid-template-columns: 1fr;
    }
    .lm-grid-preview .lm-card:nth-child(n+2) {
        display: none;
    }
    /* Small outline arrows overlapping the card's image, roughly
       centered on the thumbnail height rather than the full card
       (which includes the date/title text below it). */
    .lm-carousel-btn {
        display: flex !important;
        position: absolute !important;
        top: 110px !important;
        transform: none !important;
        width: 48px !important;
        height: 48px !important;
        border: none !important;
        background: none !important;
        margin: 0 !important;
        color: #fff;
    }
    .lm-carousel-btn svg {
        width: 38px;
        height: 38px;
        filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    }
    .lm-carousel-prev {
        left: 4px !important;
    }
    .lm-carousel-next {
        right: 4px !important;
    }
}

/* ---------- Homepage "prev/next 4" carousel arrows ---------- */

.lm-carousel-wrap {
    position: relative;
}

.lm-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--lm-accent);
    background: var(--lm-card-bg);
    color: var(--lm-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 1;
}

.lm-carousel-next {
    right: -60px;
}

.lm-carousel-prev {
    left: -60px;
}

.lm-carousel-btn svg {
    width: 20px;
    height: 20px;
}

.lm-carousel-btn:hover:not(:disabled) {
    background: var(--lm-accent);
    color: var(--lm-accent-ink);
}

.lm-carousel-btn.lm-carousel-loading {
    opacity: 0.5;
    cursor: wait;
}

.lm-carousel-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* On narrower/tablet screens there's no room for arrows to float
   outside the grid - dock them inline below instead. Scoped with a
   lower bound (641px) so this doesn't also fire on phones and
   override the phone-specific side-positioning rule above it. */
@media (min-width: 641px) and (max-width: 900px) {
    .lm-carousel-wrap {
        display: flex;
        flex-direction: column;
    }
    .lm-carousel-btn {
        position: static;
        transform: none;
        margin: 1rem 0.5rem 0;
        order: 2;
    }
    .lm-carousel-wrap {
        flex-wrap: wrap;
        justify-content: center;
    }
    .lm-grid-preview {
        order: 1;
        width: 100%;
    }
}
