/*
Theme Name: Know Your Stay
Theme URI: https://www.knowyourstay.co.za
Author: Know Your Stay
Author URI: https://www.knowyourstay.co.za
Description: A warm, proudly South African accommodation directory theme for KnowYourStay.co.za — featuring 1,837 hand-picked properties across all 9 provinces.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: Private
Text Domain: knowyourstay
Tags: accommodation, travel, south-africa, directory, custom
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --sand:       #F5F0E8;
    --earth:      #2C2416;
    --olive:      #5C6B3A;
    --gold:       #C9973A;
    --gold-light: #F0D9A8;
    --rust:       #8B4A2F;
    --cream:      #FDFAF4;
    --muted:      #7A6E5F;
    --border:     #E2D9C8;
    --white:      #FFFFFF;

    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans:  'DM Sans', system-ui, sans-serif;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;

    --shadow-sm:  0 2px 8px rgba(44, 36, 22, 0.08);
    --shadow-md:  0 8px 24px rgba(44, 36, 22, 0.10);
    --shadow-lg:  0 16px 40px rgba(44, 36, 22, 0.12);

    --max-width:  1200px;
    --nav-height: 68px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--earth);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--earth);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.serif { font-family: var(--font-serif); }
.muted { color: var(--muted); }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
}

.section {
    padding: 64px 0;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 36px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 600;
    color: var(--earth);
}

.section-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--gold);
    transition: opacity .2s;
}

.section-link:hover { opacity: .75; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
    text-decoration: none;
    letter-spacing: .02em;
}

.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--olive);
    color: var(--white);
}

.btn-gold {
    background: var(--gold);
    color: var(--earth);
}

.btn-outline {
    background: transparent;
    color: var(--earth);
    border: 1px solid var(--border);
}

.btn-white {
    background: var(--cream);
    color: var(--olive);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .05em;
}

.badge-gold {
    background: rgba(44, 36, 22, .7);
    color: var(--cream);
    backdrop-filter: blur(4px);
}

.badge-type {
    background: var(--sand);
    color: var(--muted);
    font-size: 11px;
    padding: 4px 9px;
    border-radius: var(--radius-sm);
}

/* ============================================
   NAVIGATION
   ============================================ */
.site-header {
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
}

.site-logo {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--earth);
    letter-spacing: -.3px;
    text-decoration: none;
}

.site-logo span {
    color: var(--gold);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-menu a {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .02em;
    transition: color .2s;
}

.nav-menu a:hover { color: var(--earth); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 18px;
    padding: 4px;
    transition: color .2s;
}

.nav-search-btn:hover { color: var(--earth); }

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--earth);
    border-radius: 2px;
    transition: transform .3s;
}

/* ============================================
   NAV MENU — WordPress generates a ul inside .nav-menu
   ============================================ */

.nav-menu > ul {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

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

.nav-menu > ul > li > a {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .02em;
    transition: color .2s;
    white-space: nowrap;
}

.nav-menu > ul > li > a:hover {
    color: var(--earth);
}

.nav-menu > ul > li > ul {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    padding: 8px 0;
    z-index: 200;
    list-style: none;
}

.nav-menu > ul > li:hover > ul {
    display: block;
}

.nav-menu > ul > li > ul > li > a {
    display: block;
    padding: 9px 16px;
    font-size: 13px;
    color: var(--earth);
    transition: background .15s;
}

.nav-menu > ul > li > ul > li > a:hover {
    background: var(--sand);
}

@media (max-width: 640px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--cream);
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
        box-shadow: var(--shadow-md);
        z-index: 999;
    }

    .nav-menu--open {
        display: block;
    }

    .nav-menu > ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .nav-menu > ul > li {
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu > ul > li > a {
        display: block;
        padding: 12px 0;
    }

    .nav-menu > ul > li > ul {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        padding: 0 0 8px 12px;
    }
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    background: var(--earth);
    overflow: hidden;
    padding: 96px 0 104px;
}

.hero-bg-img {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-bg-img img.loaded {
    opacity: 1;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to right, rgba(28,20,10,.92) 0%, rgba(28,20,10,.75) 55%, rgba(28,20,10,.4) 100%),
        linear-gradient(to top, rgba(28,20,10,.5) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 680px;
    z-index: 2;
}

.hero-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .18em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-eyebrow::before {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: var(--gold);
    opacity: .6;
    flex-shrink: 0;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 56px;
    font-weight: 700;
    color: var(--cream);
    line-height: 1.08;
    margin-bottom: 22px;
    letter-spacing: -.5px;
}

.hero-title em {
    color: var(--gold);
    font-style: italic;
}

.hero-subtitle {
    font-size: 17px;
    font-weight: 300;
    color: rgba(253,250,244,.65);
    line-height: 1.65;
    margin-bottom: 40px;
    max-width: 520px;
}

.hero-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(253,250,244,.07);
    border: 1px solid rgba(253,250,244,.14);
    border-radius: 12px;
    padding: 7px 7px 7px 20px;
    max-width: 540px;
    margin-bottom: 48px;
}

.hero-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--cream);
}

.hero-search input::placeholder {
    color: rgba(253,250,244,.35);
}

.hero-stats {
    display: flex;
    gap: 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(253,250,244,.1);
}

.hero-stat-num {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 600;
    color: var(--cream);
    line-height: 1;
}

.hero-stat-label {
    font-size: 12px;
    color: rgba(253,250,244,.45);
    margin-top: 5px;
    letter-spacing: .02em;
}

/* ============================================
   PROVINCE GRID
   ============================================ */
.province-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.province-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.province-card:hover .province-overlay {
    background: linear-gradient(to top, rgba(28,20,10,.95) 0%, rgba(28,20,10,.3) 65%, rgba(28,20,10,.1) 100%);
}

.province-card.large {
    grid-column: span 2;
}

.province-inner {
    position: relative;
    padding-top: 75%;
}

.province-card.large .province-inner {
    padding-top: 0;
    height: 270px;
}

.province-bg {
    position: absolute;
    inset: 0;
}

.province-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.province-card:hover .province-bg img {
    transform: scale(1.04);
}

.province-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(28,20,10,.88) 0%, rgba(28,20,10,.2) 60%, transparent 100%);
    transition: background .3s;
}

.province-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 22px;
}

.province-name {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--cream);
    line-height: 1.2;
}

.province-count {
    font-size: 12px;
    color: rgba(253,250,244,.6);
    margin-top: 4px;
}

/* Province image fallback colours — shown while image loads */
.prov-wc  { background: linear-gradient(135deg, #1e3d32, #3a6b5e); }
.prov-kzn { background: linear-gradient(135deg, #3d2010, #7a3e1a); }
.prov-ec  { background: linear-gradient(135deg, #142a45, #1e4878); }
.prov-mp  { background: linear-gradient(135deg, #2e1e0e, #5e3d1e); }
.prov-lp  { background: linear-gradient(135deg, #1e2e10, #3e5e1e); }
.prov-gp  { background: linear-gradient(135deg, #2e1020, #5e2040); }
.prov-nw  { background: linear-gradient(135deg, #2a1e10, #5a3e22); }
.prov-fs  { background: linear-gradient(135deg, #2a1a10, #6b3a1a); }
.prov-nc  { background: linear-gradient(135deg, #1a1a2e, #2e2e5e); }

/* ============================================
   LISTING CARDS
   ============================================ */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

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

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

.listing-img {
    position: relative;
    height: 190px;
    overflow: hidden;
    background: var(--sand);
}

.listing-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.listing-card:hover .listing-img img {
    transform: scale(1.04);
}

.listing-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: linear-gradient(135deg, var(--sand), var(--gold-light));
}

.listing-badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

.listing-body {
    padding: 16px 18px 18px;
}

.listing-province {
    font-size: 10px;
    font-weight: 500;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 5px;
}

.listing-name {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    color: var(--earth);
    margin-bottom: 8px;
    line-height: 1.3;
}

.listing-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 13px;
}

.listing-cta {
    font-size: 12px;
    font-weight: 500;
    color: var(--olive);
}

/* ============================================
   SINGLE LISTING PAGE
   ============================================ */
.listing-single {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 32px 80px;
}

.listing-single-header {
    margin-bottom: 32px;
}

.listing-single-province {
    font-size: 12px;
    font-weight: 500;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 10px;
}

.listing-single-title {
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 700;
    color: var(--earth);
    line-height: 1.15;
    margin-bottom: 20px;
}

.listing-single-hero {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 36px;
    max-height: 460px;
}

.listing-single-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-content {
    font-size: 16px;
    line-height: 1.75;
    color: var(--earth);
    margin-bottom: 36px;
}

.listing-content p { margin-bottom: 1rem; }
.listing-content ul { margin: 1rem 0 1rem 1.5rem; list-style: disc; }
.listing-content li { margin-bottom: .4rem; }
.listing-content strong { font-weight: 500; }

/* Booking CTA box */
.booking-cta {
    background: var(--olive);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 40px 0;
}

.booking-cta-text h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 6px;
}

.booking-cta-text p {
    font-size: 13px;
    color: rgba(253,250,244,.7);
}

/* Contact details box */
.contact-box {
    background: var(--sand);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin: 32px 0;
}

.contact-box h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--earth);
}

.contact-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.contact-label {
    font-weight: 500;
    color: var(--earth);
    min-width: 70px;
    flex-shrink: 0;
}

/* Tags */
.listing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}

.listing-tag {
    font-size: 12px;
    background: var(--sand);
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ============================================
   ARCHIVE / PROVINCE PAGES
   ============================================ */
.archive-hero {
    background: var(--earth);
    padding: 56px 0;
    position: relative;
    overflow: hidden;
}

.archive-hero-pattern {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(201,151,58,.15) 0%, transparent 50%);
}

.archive-hero-content {
    position: relative;
}

.archive-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .15em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.archive-title {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: 700;
    color: var(--cream);
    margin-bottom: 14px;
}

.archive-desc {
    font-size: 16px;
    color: rgba(253,250,244,.6);
    max-width: 520px;
    line-height: 1.6;
}

.archive-count {
    display: inline-block;
    font-size: 12px;
    background: rgba(201,151,58,.2);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 16px;
    border: 1px solid rgba(201,151,58,.3);
}

/* ============================================
   WHY SECTION
   ============================================ */
.why-section {
    background: var(--sand);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.why-card {
    background: var(--cream);
    border-radius: var(--radius-md);
    padding: 28px;
    border: 1px solid var(--border);
}

.why-icon {
    font-size: 28px;
    margin-bottom: 14px;
}

.why-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    color: var(--earth);
    margin-bottom: 10px;
}

.why-text {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.65;
}

/* ============================================
   AFFILIATE STRIP
   ============================================ */
.affiliate-strip {
    background: var(--olive);
    padding: 36px 0;
}

.affiliate-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.affiliate-text h3 {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 6px;
}

.affiliate-text p {
    font-size: 14px;
    color: rgba(253,250,244,.7);
    line-height: 1.5;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--earth);
    padding: 56px 0 0;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .site-logo {
    color: var(--cream);
    display: block;
    margin-bottom: 10px;
}

.footer-tagline {
    font-size: 13px;
    color: rgba(253,250,244,.4);
    max-width: 220px;
    line-height: 1.6;
}

.footer-cols {
    display: flex;
    gap: 56px;
}

.footer-col h4 {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(253,250,244,.3);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 13px;
    color: rgba(253,250,244,.6);
    text-decoration: none;
    margin-bottom: 9px;
    transition: color .2s;
}

.footer-col a:hover { color: var(--cream); }

.footer-bottom {
    border-top: 1px solid rgba(253,250,244,.08);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 12px;
    color: rgba(253,250,244,.28);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 48px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--earth);
    transition: all .2s;
}

.pagination a:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--earth);
}

.pagination .current {
    background: var(--olive);
    border-color: var(--olive);
    color: var(--white);
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--earth);
    outline: none;
    transition: border-color .2s;
}

.search-form input:focus {
    border-color: var(--gold);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .province-grid { grid-template-columns: repeat(2, 1fr); }
    .province-card.large { grid-column: span 2; }
    .listing-grid { grid-template-columns: repeat(2, 1fr); }
    .why-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-cols { gap: 32px; }
    .hero-title { font-size: 40px; }
}

@media (max-width: 640px) {
    .container { padding: 0 20px; }
    .province-grid { grid-template-columns: 1fr; }
    .province-card.large { grid-column: span 1; }
    .listing-grid { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    .nav-menu { display: none; }
    .nav-toggle { display: flex; }
    .hero-title { font-size: 32px; }
    .hero-stats { gap: 24px; }
    .affiliate-inner { flex-direction: column; text-align: center; }
    .footer-top { flex-direction: column; }
    .footer-cols { flex-wrap: wrap; gap: 24px; }
    .section-header { flex-direction: column; gap: 8px; }
    .booking-cta { flex-direction: column; }
}
