/*
Theme Name: Bond Calculators SA
Theme URI: https://bondcalculator.ddev.site
Author: Bond Calculators SA
Description: Custom theme for a South African bond, home loan and property calculator site. Built around the "Yacht Club" colour palette (cream, grey, teal and brown).
Version: 1.2
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: bond-calc-theme
*/

/* -----------------------------------------------------------
   1. Design tokens
----------------------------------------------------------- */
:root {
    --bc-cream: #F2F0EF;
    --bc-grey: #BBBDBC;
    --bc-teal: #245F73;
    --bc-teal-dark: #1A4351;
    --bc-teal-light: #E4ECEF;
    --bc-brown: #733E24;
    --bc-brown-light: #F4E8E0;
    --bc-text: #2A2E2E;
    --bc-text-muted: #5C6363;
    --bc-white: #FFFFFF;
    --bc-border-radius: 10px;
    --bc-max-width: 1140px;
    --bc-font-heading: Georgia, "Times New Roman", Times, serif;
    --bc-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* -----------------------------------------------------------
   2. Reset & base
----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--bc-font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--bc-text);
    background-color: var(--bc-cream);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--bc-teal); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

h1, h2, h3, h4, h5 {
    font-family: var(--bc-font-heading);
    color: var(--bc-teal-dark);
    line-height: 1.2;
    margin: 0 0 0.6em;
    font-weight: 700;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.1em; }

ul { padding-left: 1.3em; }

.container {
    max-width: var(--bc-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* -----------------------------------------------------------
   3. Buttons
----------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.85em 1.8em;
    border-radius: 999px;
    font-weight: 600;
    font-family: var(--bc-font-body);
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background-color: var(--bc-teal);
    color: var(--bc-white);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--bc-teal-dark);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--bc-brown);
    border-color: var(--bc-brown);
}
.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--bc-brown);
    color: var(--bc-white);
    text-decoration: none;
}

/* -----------------------------------------------------------
   4. Site header
----------------------------------------------------------- */
.site-header {
    background-color: var(--bc-white);
    border-bottom: 1px solid var(--bc-grey);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.site-branding .site-title-link {
    font-family: var(--bc-font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--bc-teal-dark);
    letter-spacing: 0.5px;
}
.site-branding .site-title-link:hover { text-decoration: none; color: var(--bc-teal); }

.site-branding .site-description {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--bc-text-muted);
}

.primary-nav .primary-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-nav .primary-menu > li {
    position: relative;
}

.primary-nav .primary-menu > li > a {
    display: block;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--bc-text);
    font-weight: 600;
    font-size: 0.95rem;
}

.primary-nav .primary-menu > li > a:hover,
.primary-nav .primary-menu > li.current-menu-item > a,
.primary-nav .primary-menu > li.current-menu-parent > a,
.primary-nav .primary-menu > li.current-menu-ancestor > a {
    background-color: var(--bc-teal-light);
    color: var(--bc-teal-dark);
    text-decoration: none;
}

.primary-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background-color: var(--bc-white);
    border: 1px solid var(--bc-grey);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    list-style: none;
    margin: 0;
    padding: 8px;
    z-index: 50;
}

.primary-nav .menu-item-has-children:hover > .sub-menu,
.primary-nav .menu-item-has-children:focus-within > .sub-menu {
    display: block;
}

.primary-nav .sub-menu li a {
    display: block;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--bc-text);
    font-size: 0.92rem;
    font-weight: 500;
}

.primary-nav .sub-menu li a:hover {
    background-color: var(--bc-teal-light);
    color: var(--bc-teal-dark);
    text-decoration: none;
}

/* -----------------------------------------------------------
   5. Page header band
----------------------------------------------------------- */
.page-header-band {
    background-color: var(--bc-teal);
    padding: 48px 0;
    margin-bottom: 0;
}

.page-header-band .page-title {
    color: var(--bc-white);
    margin: 0;
}

.page-content {
    padding: 48px 24px 64px;
}

/* -----------------------------------------------------------
   6. Front page hero & calculator grid
----------------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--bc-teal) 0%, var(--bc-teal-dark) 100%);
    color: var(--bc-white);
    padding: 72px 0;
    text-align: center;
}

.hero h1 {
    color: var(--bc-white);
    font-size: 2.8rem;
    margin-bottom: 0.4em;
}

.hero p {
    font-size: 1.15rem;
    max-width: 640px;
    margin: 0 auto 1.6em;
    color: var(--bc-teal-light);
}

.front-section {
    padding: 56px 0;
}

.front-section.alt {
    background-color: var(--bc-white);
}

.front-section h2 {
    text-align: center;
    margin-bottom: 0.3em;
}

.front-section .section-intro {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 2.4em;
    color: var(--bc-text-muted);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.calc-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    border-radius: var(--bc-border-radius);
    color: var(--bc-white);
    min-height: 190px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.14);
    text-decoration: none;
}

.calc-card h3 {
    color: var(--bc-white);
    margin-bottom: 0.4em;
}

.calc-card p {
    color: rgba(255,255,255,0.88);
    margin-bottom: 1.2em;
    font-size: 0.95rem;
}

.calc-card .calc-card-link {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    align-self: flex-start;
    border-bottom: 2px solid currentColor;
    padding-bottom: 2px;
}

.calc-card.tone-teal { background-color: var(--bc-teal); }
.calc-card.tone-teal-dark { background-color: var(--bc-teal-dark); }
.calc-card.tone-brown { background-color: var(--bc-brown); }
.calc-card.tone-grey { background-color: #6E7574; }
.calc-card.tone-brown-dark { background-color: #4E2A18; }
.calc-card.tone-slate { background-color: #3D5A66; }

/* -----------------------------------------------------------
   6b. Blog
----------------------------------------------------------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 24px;
}

.blog-card {
    display: block;
    color: var(--bc-text);
    text-decoration: none;
    border: 1px solid var(--bc-grey);
    border-radius: var(--bc-border-radius);
    overflow: hidden;
    background-color: var(--bc-white);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.14);
    text-decoration: none;
}

.blog-card-image {
    aspect-ratio: 16 / 10;
    background-color: var(--bc-teal-light);
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-title {
    margin: 0;
    padding: 18px 20px;
    font-size: 1.1rem;
    color: var(--bc-teal-dark);
}

.single-post-thumbnail {
    border-radius: var(--bc-border-radius);
    overflow: hidden;
    margin-bottom: 32px;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
}

.single-post-title {
    margin-bottom: 0.7em;
}

.single-post-content {
    max-width: 760px;
    font-size: 1.05rem;
}

.single-post-content > *:last-child {
    margin-bottom: 0;
}

.more-articles {
    margin-top: 56px;
    border-top: 1px solid var(--bc-grey);
    padding-top: 48px;
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------------------------
   7. Footer
----------------------------------------------------------- */
.site-footer {
    background-color: var(--bc-teal-dark);
    color: var(--bc-teal-light);
    margin-top: 0;
}

.site-footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding: 48px 0 32px;
}

.site-footer h3 {
    color: var(--bc-white);
    font-size: 1.1rem;
    margin-bottom: 0.8em;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer ul li { margin-bottom: 8px; }

.site-footer a {
    color: var(--bc-teal-light);
}
.site-footer a:hover { color: var(--bc-white); }

.site-footer p { color: var(--bc-teal-light); }

.site-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 18px 0;
    font-size: 0.85rem;
    text-align: center;
    color: rgba(228,236,239,0.7);
}

/* -----------------------------------------------------------
   8. Responsive
----------------------------------------------------------- */
@media (max-width: 720px) {
    h1 { font-size: 1.9rem; }
    .hero h1 { font-size: 2.1rem; }
    .site-header-inner { flex-direction: column; align-items: flex-start; }
    .primary-nav .primary-menu { gap: 2px; }
    .primary-nav .sub-menu { position: static; box-shadow: none; border: none; padding-left: 12px; }
}
