/* ============================================================
   Van Happiness – Custom Homepage Styles
   Colors come from Blocksy CSS variables (palette_color_slot
   in homepage.json controls which palette slot is used).
   ============================================================ */

/* ── Tokens ───────────────────────────────────────────────── */
.vh-hp {
    /* --vh-accent and --vh-accent-dark are injected inline
       by the template using the configured palette slot.
       These are only fallbacks if the slot variables are unset. */
    --vh-accent:      var(--theme-palette-color-1, #2563eb);
    --vh-accent-dark: var(--theme-palette-color-2, #1d4ed8);
    --vh-text:        var(--theme-text-color, #1a1a1a);
    --vh-muted:       #666;
    --vh-bg:          var(--theme-background-color, #fff);
    --vh-bg-alt:      #f7f7f5;
    --vh-border:      #e5e5e5;
    --vh-radius:      10px;
    --vh-shadow:      0 2px 12px rgba(0,0,0,.08);
    --vh-max-w:       1160px;
    --vh-gap:         24px;

    color: var(--vh-text);
    background: var(--vh-bg);
}

/* ── Shared helpers ───────────────────────────────────────── */
.vh-container {
    max-width: var(--vh-max-w);
    margin: 0 auto;
    padding: 0 20px;
}

.vh-section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 .5rem;
    text-align: center;
}

.vh-section-sub {
    color: var(--vh-muted);
    text-align: center;
    margin: 0 0 2.5rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Buttons ──────────────────────────────────────────────── */
.vh-btn {
    display: inline-block;
    padding: 13px 28px;
    border-radius: var(--vh-radius);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: background .18s, color .18s, border-color .18s;
    line-height: 1;
    cursor: pointer;
}

.vh-btn--primary {
    background: var(--vh-accent);
    color: #fff;
    border: 2px solid var(--vh-accent);
}
.vh-btn--primary:hover {
    background: var(--vh-accent);
    border-color: var(--vh-accent);
    color: #fff;
    filter: brightness(0.87);
}

.vh-btn--outline {
    background: transparent;
    color: var(--vh-accent);
    border: 2px solid var(--vh-accent);
}
.vh-btn--outline:hover {
    background: var(--vh-accent);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════ */
.vh-hero {
    background: linear-gradient(135deg, var(--vh-accent) 0%, var(--vh-accent-dark) 100%);
    color: #fff;
    padding: 90px 20px 80px;
    text-align: center;
}

.vh-hero__title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 0 0 1rem;
    color: #fff;
    line-height: 1.15;
}

.vh-hero__sub {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    opacity: .9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.vh-hero__ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.vh-hero .vh-btn--primary {
    background: #fff;
    color: var(--vh-accent);
    border-color: #fff;
}
.vh-hero .vh-btn--primary:hover {
    background: #f0f0f0;
    border-color: #f0f0f0;
    color: var(--vh-accent);
}
.vh-hero .vh-btn--outline {
    color: #fff;
    border-color: rgba(255,255,255,.7);
}
.vh-hero .vh-btn--outline:hover {
    background: rgba(255,255,255,.15);
    border-color: #fff;
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   TRUST BAR
   ══════════════════════════════════════════════════════════ */
.vh-trust {
    background: var(--vh-bg-alt);
    border-top: 1px solid var(--vh-border);
    border-bottom: 1px solid var(--vh-border);
    padding: 24px 20px;
}

.vh-trust__inner {
    display: flex;
    gap: 12px 32px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.vh-trust__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    font-weight: 600;
}

.vh-trust__icon { font-size: 1.1rem; }

/* ══════════════════════════════════════════════════════════
   CATEGORIES
   ══════════════════════════════════════════════════════════ */
.vh-cats {
    padding: 70px 20px;
    background: var(--vh-bg);
}

.vh-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--vh-gap);
}

.vh-cat-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--vh-border);
    border-radius: var(--vh-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--vh-text);
    background: var(--vh-bg);
    box-shadow: var(--vh-shadow);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.vh-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    border-color: var(--vh-accent);
}

.vh-cat-card__img {
    width: 100%;
    height: 240px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--vh-bg-alt);
    border-bottom: 1px solid var(--vh-border);
}

.vh-cat-card__body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.vh-cat-card__name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
}

.vh-cat-card__count {
    font-size: .8rem;
    color: var(--vh-muted);
}

.vh-cat-card:not(.vh-cat-card--has-img) {
    justify-content: center;
    padding: 28px 18px;
    min-height: 100px;
}
.vh-cat-card:not(.vh-cat-card--has-img) .vh-cat-card__body {
    padding: 0;
}

/* ══════════════════════════════════════════════════════════
   SHARED POST CARD  (used by Recent + Popular sections)
   Matches the blog page: no card box, full-width text,
   generous vertical whitespace between elements.
   ══════════════════════════════════════════════════════════ */
.vh-post-card {
    display: flex;
    flex-direction: column;
}

.vh-post-card__cat {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--theme-palette-color-1, var(--vh-accent));
    line-height: 1;
    margin-bottom: 12px;
}

.vh-post-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 20px;
}
.vh-post-card__title a {
    color: var(--theme-headings-color, var(--vh-text));
    text-decoration: none;
}
.vh-post-card__title a:hover { color: var(--theme-palette-color-1, var(--vh-accent)); }

.vh-post-card__img-wrap {
    display: block;
    overflow: hidden;
    flex-shrink: 0;
    margin-bottom: 20px;
}
.vh-post-card__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.vh-post-card:hover .vh-post-card__img { transform: scale(1.03); }

.vh-post-card__excerpt {
    font-size: .9rem;
    color: var(--theme-text-color, #555);
    line-height: 1.7;
    margin: 0 0 18px;
    flex: 1;
}

.vh-post-card__meta {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--theme-text-color, #555);
}
.vh-post-card__author::after {
    content: ' / ';
    font-weight: 400;
}

/* ══════════════════════════════════════════════════════════
   RECENT POSTS
   ══════════════════════════════════════════════════════════ */
.vh-recent {
    padding: 70px 20px;
    background: var(--vh-bg);
}

.vh-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px 40px;
    margin-bottom: 2.5rem;
}

.vh-recent__cta { text-align: center; }

/* ══════════════════════════════════════════════════════════
   POPULAR POSTS  (re-uses .vh-post-card)
   ══════════════════════════════════════════════════════════ */
.vh-popular {
    padding: 70px 20px;
    background: var(--vh-bg-alt);
}

.vh-popular-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px 40px;
}

/* ══════════════════════════════════════════════════════════
   NEWSLETTER
   ══════════════════════════════════════════════════════════ */
.vh-newsletter {
    background: var(--vh-accent);
    padding: 70px 20px;
}

.vh-newsletter__inner {
    max-width: 580px;
    margin: 0 auto;
    text-align: center;
}

.vh-newsletter__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #fff;
    margin: 0 0 .75rem;
}

.vh-newsletter__sub {
    color: rgba(255,255,255,.85);
    margin: 0 0 1.75rem;
    line-height: 1.6;
}

.vh-newsletter__form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.vh-newsletter__input {
    flex: 1 1 260px;
    padding: 13px 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-radius: var(--vh-radius);
    font-size: .95rem;
    outline: none;
    background: rgba(255,255,255,.15);
    color: #fff !important;
    box-shadow: 0 0 0 3px transparent;
    transition: box-shadow .18s, border-color .18s, background .18s;
}
.vh-newsletter__input::placeholder {
    color: rgba(255,255,255,.7) !important;
    opacity: 1;
}
.vh-newsletter__input:focus {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.75);
    box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}

.vh-newsletter .vh-btn--primary {
    background: #fff;
    color: var(--vh-accent);
    border-color: #fff;
    white-space: nowrap;
}
.vh-newsletter .vh-btn--primary:hover {
    background: #f0f0f0;
    border-color: #f0f0f0;
    color: var(--vh-accent);
}

.vh-newsletter__thanks {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════
   HOW WE RANK
   ══════════════════════════════════════════════════════════ */
.vh-rank {
    padding: 70px 20px;
    background: var(--vh-bg-alt);
}

.vh-rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--vh-gap);
}

.vh-rank-card {
    background: var(--vh-bg);
    border: 1px solid var(--vh-border);
    border-radius: var(--vh-radius);
    padding: 28px 22px;
    box-shadow: var(--vh-shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vh-rank-card__icon {
    font-size: 2rem;
    line-height: 1;
}

.vh-rank-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--vh-text);
}

.vh-rank-card__text {
    font-size: .875rem;
    color: var(--vh-muted);
    line-height: 1.6;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════
   ABOUT
   ══════════════════════════════════════════════════════════ */
.vh-about {
    padding: 70px 20px;
    background: var(--vh-bg);
    border-top: 1px solid var(--vh-border);
}

.vh-about__inner {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.vh-about__text { flex: 1 1 320px; }

.vh-about__text h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    margin: 0 0 1rem;
}

.vh-about__text p {
    color: var(--vh-muted);
    line-height: 1.7;
    margin: 0 0 1rem;
}

.vh-about__text .vh-btn { margin-top: .5rem; }

.vh-about__icon {
    font-size: 6rem;
    line-height: 1;
    flex-shrink: 0;
    opacity: .15;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .vh-posts-grid,
    .vh-popular-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; }
}

@media (max-width: 640px) {
    .vh-hero { padding: 60px 20px 50px; }

    .vh-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .vh-cat-card__img { height: 180px; }

    .vh-posts-grid,
    .vh-popular-grid { grid-template-columns: 1fr; gap: 36px 0; }

    .vh-newsletter__form { flex-direction: column; }
    .vh-newsletter__input { flex-basis: auto; }

    .vh-rank-grid { grid-template-columns: 1fr 1fr; }

    .vh-about__icon { display: none; }

    .vh-trust__inner { justify-content: flex-start; }
}

@media (max-width: 400px) {
    .vh-rank-grid { grid-template-columns: 1fr; }
}
