/*
 * base.css — structural styles shared by every site.
 * Colour and typography come entirely from CSS custom properties that each
 * theme file (/themes/<name>.css) supplies. Never hard-code a colour here.
 */

*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    color: var(--heading);
}

a { color: var(--brand-strong); }

.wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- Advertising disclosure bar ---------- */

.topbar {
    background: var(--topbar-bg);
    color: var(--topbar-text);
    font-size: .74rem;
    line-height: 1.5;
    padding: .5rem 0;
    text-align: center;
}

.topbar a { color: var(--topbar-text); text-decoration: underline; }

/* ---------- Header / navigation ---------- */

.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 66px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--header-logo);
    text-decoration: none;
    letter-spacing: .2px;
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--header-link);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.1px;
}

.main-nav a:hover { color: var(--header-link-hover); }

/* ---------- Hero ---------- */

.hero {
    background: var(--hero-bg);
    color: var(--hero-text);
    text-align: center;
    padding: 3.25rem 0 2.5rem;
}

.hero--tall { padding: 4.5rem 0 4rem; }

.hero__title {
    color: var(--hero-text);
    font-size: 2.3rem;
    max-width: 800px;
    margin: 0 auto .75rem;
}

.hero--tall .hero__title { font-size: 2.6rem; }

.hero__sub {
    color: var(--hero-sub);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.02rem;
}

.meta-line {
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    margin: 1.25rem 0 0;
}

/* ---------- Sections ---------- */

.band { padding: 3rem 0; }
.band--soft { background: var(--soft); }

.section-title {
    font-size: 1.45rem;
    margin-bottom: 1.5rem;
    color: var(--heading);
}

.section-title--center { text-align: center; }

.section-label {
    font-family: var(--font-heading);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--brand-strong);
    margin-bottom: 1rem;
}

/* ---------- Listing cards ---------- */

.listings { display: grid; gap: 1.1rem; }

.listing {
    position: relative;
    display: grid;
    grid-template-columns: 52px 1fr 118px 148px;
    gap: 1.4rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow);
}

.listing:hover { box-shadow: var(--shadow-hover); }

.listing--featured { border: 2px solid var(--brand); }

.listing__rank {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rank);
    text-align: center;
}

.listing__name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--heading);
}

.listing__offer {
    color: var(--brand-strong);
    font-weight: 600;
    font-size: .93rem;
    margin: .15rem 0 .35rem;
}

.listing__points {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: .88rem;
}

.listing__points li { padding-left: 1.35rem; position: relative; }

.listing__points li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--brand);
    font-weight: 700;
}

.listing__score {
    text-align: center;
    border-left: 1px solid var(--line);
    padding-left: .9rem;
}

.listing__score b {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.1;
    color: var(--score);
}

.listing__score span {
    display: block;
    font-size: .78rem;
    color: var(--muted);
}

.badge {
    position: absolute;
    top: -11px;
    left: 20px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-family: var(--font-heading);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
}

/* ---------- Call to action ---------- */

.cta {
    display: inline-block;
    background: var(--cta-bg);
    color: var(--cta-text);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    padding: .8rem 1.3rem;
    border-radius: var(--radius-cta);
}

.cta:hover { background: var(--cta-hover); color: var(--cta-text); }

/* ---------- Portal tiles ---------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.25rem;
}

.tile {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--brand);
    border-radius: var(--radius);
    padding: 1.9rem 1.2rem;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}

.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.tile__icon { display: block; font-size: 2.2rem; line-height: 1; margin-bottom: .7rem; }

.tile__title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .86rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--heading);
}

.tile__blurb {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    margin-top: .45rem;
    line-height: 1.55;
}

/* ---------- Value propositions ---------- */

.advantages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    text-align: center;
}

.advantage h3 {
    font-size: .84rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--brand-strong);
    margin-bottom: .55rem;
}

.advantage p { font-size: .9rem; color: var(--muted); margin: 0; }

/* ---------- Editor-authored homepage copy ---------- */

.home-copy {
    max-width: 760px;
    margin: 0 auto;
}

.home-copy h2 {
    font-size: 1.4rem;
    margin: 2rem 0 .75rem;
}

.home-copy h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 .5rem;
}

.home-copy h2:first-child,
.home-copy h3:first-child { margin-top: 0; }

.home-copy p { margin: 0 0 1rem; }

.home-copy ul,
.home-copy ol { margin: 0 0 1rem; padding-left: 1.35rem; }

.home-copy li { margin-bottom: .35rem; }

.home-copy a { color: var(--brand-strong); }

/* ---------- Content pages ---------- */

.page-body {
    max-width: 760px;
    margin: 2.5rem auto 3rem;
    padding: 0 1.5rem;
}

.page-body p { margin: 0 0 1rem; }

/* ---------- Footer ---------- */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    font-size: .84rem;
    text-align: center;
    padding: 2.25rem 0 2rem;
    margin-top: 3rem;
}

.footer-nav {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    justify-content: center;
    padding: 0;
    margin: 0 0 1rem;
}

.site-footer a { color: var(--footer-link); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
    .site-header__inner { flex-direction: column; gap: .55rem; padding: .85rem 0; }
    .main-nav ul { justify-content: center; gap: 1.1rem; }

    .hero__title,
    .hero--tall .hero__title { font-size: 1.75rem; }

    .listing {
        grid-template-columns: 40px 1fr;
        row-gap: .85rem;
        padding: 1.5rem 1.1rem 1.2rem;
    }

    .listing__score {
        grid-column: 2;
        text-align: left;
        border-left: 0;
        padding-left: 0;
    }

    .listing__score b { display: inline; margin-right: .4rem; }
    .listing__score span { display: inline; }
    .listing__cta { grid-column: 2; }
    .cta { display: block; }
}
