/*
Theme Name: SPARC Theme
Theme URI: https://staffordshireportable.co.uk
Description: Custom theme for Staffordshire Portable Amateur Radio Club
Author: Interruptive Studios
Version: 2.2
License: GNU General Public License v2 or later
*/

/* ==========================================================================
   RESET & BODY DEFAULTS
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f3f5f8;
    color: #5A6478;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ==========================================================================
   ELEMENTOR CANVAS OVERRIDE
   ========================================================================== */

body.elementor-template-canvas {
    padding: 0;
    background: #fff;
}

body.elementor-template-canvas .sp-topbar,
body.elementor-template-canvas .sp-hdr,
body.elementor-template-canvas .sp-ft {
    display: none;
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */

.sp-topbar {
    background: #060C1E;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 8px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sp-topbar a {
    color: #D4A843;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.sp-topbar a:hover {
    color: #E8C86A;
}

.sp-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.sp-hdr {
    background: #0A1628;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.sp-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.sp-logo img {
    height: 40px;
    width: auto;
}

.sp-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sp-logo-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.sp-logo-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.sp-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
}

.sp-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sp-nav a.sp-nav-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sp-nav a.sp-nav-active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: #D4A843;
    border-radius: 1px;
}

.sp-nav-cta {
    background: #D4A843 !important;
    color: #0A1628 !important;
    font-weight: 600 !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    margin-left: 8px;
    transition: background 0.2s ease, transform 0.15s ease !important;
}

.sp-nav-cta:hover {
    background: #E8C86A !important;
    transform: translateY(-1px);
}

.sp-nav-cta.sp-nav-active::after {
    display: none;
}

/* ==========================================================================
   HAMBURGER MENU
   ========================================================================== */

.sp-burger-toggle {
    display: none;
}

.sp-burger {
    display: none;
    cursor: pointer;
    width: 28px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.sp-burger span,
.sp-burger span::before,
.sp-burger span::after {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sp-burger span {
    top: 50%;
    transform: translateY(-50%);
}

.sp-burger span::before {
    content: '';
    top: -8px;
}

.sp-burger span::after {
    content: '';
    top: 8px;
}

/* Burger open state */
.sp-burger-toggle:checked ~ .sp-hdr .sp-burger span {
    background: transparent;
}

.sp-burger-toggle:checked ~ .sp-hdr .sp-burger span::before {
    top: 0;
    transform: rotate(45deg);
}

.sp-burger-toggle:checked ~ .sp-hdr .sp-burger span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ==========================================================================
   PAGE HERO (Inner pages)
   ========================================================================== */

.sp-page-hero {
    background: #0A1628;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 30px;
    position: relative;
    overflow: hidden;
}

.sp-page-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sp-page-hero-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #D4A843;
    margin-bottom: 16px;
    position: relative;
}

.sp-page-hero-tag::before {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: #D4A843;
    margin: 0 auto 10px;
    border-radius: 1px;
}

.sp-page-hero h1 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    line-height: 1.05;
    letter-spacing: -2px;
    margin: 0;
}

.sp-page-hero p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    max-width: 560px;
    margin-top: 12px;
}

/* ==========================================================================
   ABOUT PAGE GRID
   ========================================================================== */

.sp-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.sp-about-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

@media (max-width: 768px) {
    .sp-about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ==========================================================================
   PAGE CONTENT CONTAINER
   ========================================================================== */

.sp-page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 30px 80px;
}

/* ==========================================================================
   PAGE CONTENT TYPOGRAPHY
   ========================================================================== */

.sp-page-content h1,
.sp-page-content h2,
.sp-page-content h3,
.sp-page-content h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #0A1628;
    line-height: 1.3;
}

.sp-page-content h1 {
    font-size: 36px;
    margin-bottom: 24px;
}

.sp-page-content h2 {
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 16px;
}

.sp-page-content h3 {
    font-size: 22px;
    margin-top: 32px;
    margin-bottom: 12px;
}

.sp-page-content h4 {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 10px;
}

.sp-page-content p {
    font-size: 16px;
    line-height: 1.75;
    color: #5A6478;
    margin-bottom: 20px;
}

.sp-page-content ul,
.sp-page-content ol {
    margin: 16px 0 24px 24px;
    color: #5A6478;
}

.sp-page-content li {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.sp-page-content a {
    color: #D4A843;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.sp-page-content a:hover {
    color: #0A1628;
    border-bottom-color: #D4A843;
}

.sp-page-content blockquote {
    border-left: 3px solid #D4A843;
    padding: 16px 24px;
    margin: 24px 0;
    background: #FFF5E0;
    border-radius: 0 8px 8px 0;
    color: #0A1628;
    font-style: italic;
}

.sp-page-content hr {
    border: none;
    height: 1px;
    background: #E8E4DE;
    margin: 40px 0;
}

.sp-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.sp-page-content th,
.sp-page-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #E8E4DE;
    font-size: 15px;
}

.sp-page-content th {
    background: #0A1628;
    color: #fff;
    font-weight: 600;
}

.sp-page-content tr:hover td {
    background: #FFF5E0;
}

/* ==========================================================================
   EVENTS CALENDAR
   ========================================================================== */

/* Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #5A6478;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.confirmed { background: #2ecc71; }
.legend-dot.tbc       { background: #f39c12; }
.legend-dot.cancelled { background: #e74c3c; }

/* Calendar grid */
.calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-top: 24px;
}

/* Month cards */
.month {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #E8E4DE;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.month:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.month h3 {
    margin-bottom: 14px;
    color: #0A1628;
    border-bottom: 2px solid #E8E4DE;
    padding-bottom: 8px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Event rows */
.event {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8F6F3;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-left: 3px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event:last-child {
    margin-bottom: 0;
}

.event:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* Left border accent per status */
.event-confirmed { border-left-color: #2ecc71; }
.event-tbc       { border-left-color: #f39c12; }
.event-cancelled { border-left-color: #e74c3c; }

/* Event text */
.event div {
    font-size: 14px;
    color: #5A6478;
    line-height: 1.4;
}

.event strong {
    font-weight: 600;
    color: #0A1628;
}

/* Date badges */
.date {
    min-width: 44px;
    text-align: center;
    padding: 7px 9px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

/* Status colours */
.confirmed {
    background: #2ecc71;
    color: #fff;
}

.tbc {
    background: #f39c12;
    color: #fff;
}

.cancelled {
    background: #e74c3c;
    color: #fff;
}

.tbc-text {
    font-size: 11px;
    font-weight: 600;
    color: #e67e22;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cancelled-text {
    font-size: 11px;
    font-weight: 600;
    color: #e74c3c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */

.sp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.sp-gallery-grid figure {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #E8E4DE;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sp-gallery-grid figure:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.sp-gallery-grid img {
    width: 100%;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.sp-gallery-grid figcaption {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #5A6478;
    background: #F8F6F3;
    border-top: 1px solid #E8E4DE;
    text-align: center;
}

/* Legacy gallery-grid support */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.gallery-grid figure {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.gallery-grid img {
    width: 100%;
    display: block;
}

.gallery-grid figcaption {
    padding: 10px 12px;
    font-size: 14px;
    color: #5A6478;
    background: #F8F6F3;
    border-top: 1px solid #E8E4DE;
    text-align: center;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.sp-ft {
    background: #0A1628;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 24px 30px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   RESPONSIVE — 900px (Tablet)
   ========================================================================== */

@media (max-width: 900px) {
    .sp-topbar {
        padding: 8px 24px;
        font-size: 11px;
    }

    .sp-hdr {
        padding: 14px 24px;
    }

    .sp-page-hero h1 {
        font-size: 34px;
    }

    .sp-page-content {
        padding: 40px 24px 60px;
    }

    .sp-page-content h1 {
        font-size: 30px;
    }

    .sp-page-content h2 {
        font-size: 24px;
    }

    .sp-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
}

/* ==========================================================================
   RESPONSIVE — 768px (Hamburger + Mobile Nav)
   ========================================================================== */

@media (max-width: 768px) {
    .sp-burger {
        display: block;
    }

    .sp-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: #0D1B36;
        flex-direction: column;
        align-items: stretch;
        padding: 80px 24px 40px;
        gap: 4px;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.3);
        z-index: 999;
        overflow-y: auto;
    }

    .sp-burger-toggle:checked ~ .sp-hdr .sp-nav {
        transform: translateX(0);
    }

    .sp-nav a {
        font-size: 16px;
        padding: 12px 16px;
        border-radius: 8px;
    }

    .sp-nav a.sp-nav-active::after {
        display: none;
    }

    .sp-nav a.sp-nav-active {
        background: rgba(212, 168, 67, 0.12);
        color: #D4A843;
    }

    .sp-nav-cta {
        margin-left: 0 !important;
        margin-top: 12px;
        text-align: center;
    }

    .sp-page-hero {
        min-height: 200px;
        padding: 50px 24px;
    }

    .sp-page-hero h1 {
        font-size: 30px;
    }
}

/* ==========================================================================
   RESPONSIVE — 600px (Small Tablets / Large Phones)
   ========================================================================== */

@media (max-width: 600px) {
    .sp-topbar {
        padding: 6px 16px;
        font-size: 10px;
    }

    .sp-topbar span:first-child {
        display: none;
    }

    .sp-hdr {
        padding: 12px 16px;
    }

    .sp-logo img {
        height: 32px;
    }

    .sp-logo-name {
        font-size: 18px;
    }

    .sp-logo-sub {
        font-size: 9px;
    }

    .sp-page-hero {
        min-height: 180px;
        padding: 40px 16px;
    }

    .sp-page-hero h1 {
        font-size: 26px;
    }

    .sp-page-content {
        padding: 30px 16px 50px;
    }

    .sp-page-content h1 {
        font-size: 26px;
    }

    .sp-page-content h2 {
        font-size: 22px;
    }

    .sp-page-content h3 {
        font-size: 19px;
    }

    .calendar {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calendar-legend {
        gap: 14px;
    }

    .sp-gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .sp-ft {
        padding: 20px 16px;
        font-size: 12px;
    }
}

/* ==========================================================================
   RESPONSIVE — 380px (Small Phones)
   ========================================================================== */

@media (max-width: 380px) {
    .sp-hdr {
        padding: 10px 12px;
    }

    .sp-logo img {
        height: 28px;
    }

    .sp-logo-name {
        font-size: 16px;
    }

    .sp-logo-sub {
        display: none;
    }

    .sp-nav {
        width: 100%;
    }

    .sp-page-hero h1 {
        font-size: 22px;
    }

    .sp-page-content {
        padding: 24px 12px 40px;
    }

    .sp-page-content p,
    .sp-page-content li {
        font-size: 15px;
    }
}
