/*
 * "Terms & Policies - Overview" page (IB-1443).
 * Moved here from the "Custom CSS & JS" plugin snippet and restyled a little.
 * Loaded only on the overview page (body.japebo-legal-overview), see
 * includes/class-legal-overview.php. Every rule starts with that body class,
 * so nothing here can touch another page.
 *
 * Colours: the cards are always white, so each card redefines the --theme-*
 * custom properties locally. That keeps text dark and readable when a season
 * theme (base.css, !important colours) is active, same trick as blog.css.
 * Green is the shop's own accent (Flatsome primary colour, #4dae65); the
 * button uses a darker green so white text has enough contrast (4.9:1).
 */

/* ===== Grid ===== */
body.japebo-legal-overview .legal-grid {
    display: grid;
    gap: 20px;
    margin-top: 28px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    body.japebo-legal-overview .legal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
    body.japebo-legal-overview .legal-grid { grid-template-columns: repeat(3, 1fr); }
}
/* WordPress turns the HTML comments between the cards into empty paragraphs;
   as grid items they would take up cells. */
body.japebo-legal-overview .legal-grid > p:empty,
body.japebo-legal-overview .legal-grid .cta-group > br {
    display: none;
}

/* ===== Card ===== */
body.japebo-legal-overview .legal-grid .legal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    padding: 24px;
    background: #fff;
    border: 1px solid #e4e8e5;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    --theme-text: #2b2b2b;
    --theme-body-link: #1f6f3a;
    --theme-body-link-hover: #1f6f3a;
}
body.japebo-legal-overview .legal-grid .legal-card:hover,
body.japebo-legal-overview .legal-grid .legal-card:focus-within {
    border-color: #4dae65;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
body.japebo-legal-overview .legal-grid .legal-card-body { flex: 1; }

body.japebo-legal-overview .legal-grid .legal-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: #eef7f0;
    font-size: 24px;
}
body.japebo-legal-overview .legal-grid .legal-card h3 {
    margin: 0 0 8px;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: normal;
    color: #1d1d1d;
}
body.japebo-legal-overview .legal-grid .legal-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

/* ===== Buttons ===== */
body.japebo-legal-overview .legal-grid .cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
body.japebo-legal-overview .legal-grid .cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 16px;
    background: #fff;
    border: 1.5px solid #2f8a48;
    border-radius: 6px;
    color: #1f6f3a !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
body.japebo-legal-overview .legal-grid .cta-badge:hover {
    background: #2f8a48;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
body.japebo-legal-overview .legal-grid .cta-badge:focus-visible {
    outline: 3px solid #4dae65;
    outline-offset: 2px;
}
body.japebo-legal-overview .legal-grid .cta-icon { font-size: 1em; }
body.japebo-legal-overview .legal-grid .legal-card a:hover { text-decoration: none; }

/* ===== Mobile ===== */
@media (max-width: 520px) {
    body.japebo-legal-overview .legal-grid { gap: 14px; }
    body.japebo-legal-overview .legal-grid .legal-card { padding: 18px; }
    body.japebo-legal-overview .legal-grid .legal-card-icon {
        width: 40px; height: 40px; font-size: 20px; margin-bottom: 10px;
    }
    body.japebo-legal-overview .legal-grid .cta-group {
        flex-direction: column;
        gap: 8px;
        margin-top: 16px;
    }
    body.japebo-legal-overview .legal-grid .cta-badge {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.japebo-legal-overview .legal-grid .legal-card,
    body.japebo-legal-overview .legal-grid .cta-badge { transition: none; }
    body.japebo-legal-overview .legal-grid .legal-card:hover,
    body.japebo-legal-overview .legal-grid .legal-card:focus-within { transform: none; }
}
