/* ============================================================
   Sacramento Diamond Foundation — Custom Styles
   Palette derived from Sac Diamond-Donation letter logo.png
   Design inspired by James Beard Foundation (jamesbeard.org)
   ============================================================ */

:root {
    /* === Primary burgundy palette (from logo) === */
    --sdf-burgundy:     #7A0511;
    --sdf-burgundy-alt: #82181B;
    --sdf-brick:        #97453B;

    /* === Warm supporting tones === */
    --sdf-terracotta:   #B97C6E;
    --sdf-rose:         #D5ACA0;
    --sdf-blush:        #E9D2C9;
    --sdf-cream:        #F3E8E4;

    /* === Neutrals === */
    --sdf-text:         #1A1A1A;
    --sdf-text-muted:   #4A4A4A;
    --sdf-white:        #FFFFFF;
    --sdf-bg-alt:       #F5F0EE;
    --sdf-border:       #D4C4BC;

    /* === Override Kadence global palette === */
    --global-palette1:  #7A0511;  /* Primary */
    --global-palette2:  #1A1A1A;  /* Heading */
    --global-palette3:  #4A4A4A;  /* Body text */
    --global-palette4:  #1A1A1A;  /* Dark */
    --global-palette5:  #4A4A4A;  /* Gray */
    --global-palette6:  #7A0511;  /* Accent */
    --global-palette7:  #F3E8E4;  /* Light bg */
    --global-palette8:  #F5F0EE;  /* Alt bg */
    --global-palette9:  #FFFFFF;  /* White */
}

/* ============================================================
   Typography
   ============================================================ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--sdf-text);
    -webkit-font-smoothing: antialiased;
    background: var(--sdf-white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    color: var(--sdf-text);
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); line-height: 1.25; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); line-height: 1.35; }

.site-title,
.main-navigation a,
button,
input,
select,
textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   Header / Navigation — JBF-style clean bar
   ============================================================ */

.site-header {
    background: var(--sdf-white);
    border-bottom: 1px solid var(--sdf-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.site-header .site-branding .site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    color: var(--sdf-burgundy);
}

/* Nav links */
.main-navigation .menu > .menu-item > a {
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--sdf-text);
    padding: 0.75rem 1rem;
    transition: color 0.2s ease;
}

.main-navigation .menu > .menu-item > a:hover {
    color: var(--sdf-burgundy);
}

/* Current page */
.main-navigation .menu > .current-menu-item > a {
    color: var(--sdf-burgundy);
    font-weight: 600;
}

/* === DONATE BUTTON — always prominent === */
.main-navigation .menu > .menu-donate > a,
.menu-item.donate-button a {
    background: var(--sdf-burgundy);
    color: var(--sdf-white) !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.main-navigation .menu > .menu-donate > a:hover,
.menu-item.donate-button a:hover {
    background: var(--sdf-burgundy-alt);
    color: var(--sdf-white) !important;
}

/* Mobile nav toggle */
.mobile-toggle-button {
    color: var(--sdf-burgundy);
}

/* ============================================================
   Hero Section
   ============================================================ */

.sdf-hero {
    position: relative;
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    padding: 6rem 2rem 5rem;
    text-align: center;
    overflow: hidden;
}

.sdf-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(122, 5, 17, 0.95) 0%,
        rgba(130, 24, 27, 0.85) 50%,
        rgba(151, 69, 59, 0.7) 100%
    );
    z-index: 1;
}

.sdf-hero.has-image::before {
    background: linear-gradient(
        135deg,
        rgba(122, 5, 17, 0.9) 0%,
        rgba(122, 5, 17, 0.75) 100%
    );
}

.sdf-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
}

.sdf-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--sdf-white);
    margin-bottom: 1rem;
}

.sdf-hero p {
    font-size: 1.15rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
    color: var(--sdf-blush);
}

.sdf-hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Buttons
   ============================================================ */

.sdf-btn,
.wp-block-button__link,
.wp-element-button {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.sdf-btn-primary,
.wp-block-button .wp-block-button__link {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    border: 2px solid var(--sdf-burgundy);
}

.sdf-btn-primary:hover,
.wp-block-button .wp-block-button__link:hover {
    background: var(--sdf-burgundy-alt);
    border-color: var(--sdf-burgundy-alt);
    color: var(--sdf-white);
}

.sdf-btn-outline {
    background: transparent;
    color: var(--sdf-white);
    border: 2px solid var(--sdf-white);
}

.sdf-btn-outline:hover {
    background: var(--sdf-white);
    color: var(--sdf-burgundy);
}

/* Secondary (on light backgrounds) */
.sdf-btn-secondary {
    background: transparent;
    color: var(--sdf-burgundy);
    border: 2px solid var(--sdf-burgundy);
}

.sdf-btn-secondary:hover {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
}

/* ============================================================
   Sections
   ============================================================ */

.sdf-section {
    padding: 5rem 2rem;
}

.sdf-section-alt {
    background: var(--sdf-cream);
}

.sdf-section-dark {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
}

.sdf-section-cream {
    background: var(--sdf-bg-alt);
}

.sdf-section-dark h2,
.sdf-section-dark h3 {
    color: var(--sdf-white);
}

.sdf-section-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sdf-burgundy);
    margin-bottom: 0.5rem;
}

.sdf-section-dark .sdf-section-label {
    color: var(--sdf-rose);
}

/* ============================================================
   Impact Stats
   ============================================================ */

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

.sdf-stat-number {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--sdf-burgundy);
    line-height: 1;
}

.sdf-section-dark .sdf-stat-number {
    color: var(--sdf-white);
}

.sdf-stat-label {
    font-size: 0.9rem;
    color: var(--sdf-text-muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sdf-section-dark .sdf-stat-label {
    color: var(--sdf-rose);
}

/* ============================================================
   Card Grid (Programs, Events, etc.)
   ============================================================ */

.sdf-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.sdf-card {
    background: var(--sdf-white);
    border: 1px solid var(--sdf-border);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sdf-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.sdf-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--sdf-blush);
}

.sdf-card-body {
    padding: 1.5rem;
}

.sdf-card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sdf-card-body p {
    font-size: 0.9rem;
    color: var(--sdf-text-muted);
    line-height: 1.5;
}

/* ============================================================
   Impact Stories Carousel
   ============================================================ */

.sdf-carousel-wrapper {
    max-width: 1100px;
    margin: 2rem auto 0;
    padding: 0 2rem;
}

.sdf-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0.5rem;
    scrollbar-width: none;
}

.sdf-carousel::-webkit-scrollbar { display: none; }

.sdf-carousel-card {
    flex: 0 0 320px;
    scroll-snap-align: start;
    background: var(--sdf-white);
    border: 1px solid var(--sdf-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.sdf-carousel-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.sdf-carousel-card h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    color: var(--sdf-burgundy);
    margin: 0.5rem 0 0.75rem;
}

.sdf-carousel-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--sdf-text);
    margin: 0 0 1rem;
}

.sdf-carousel-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--sdf-cream);
    color: var(--sdf-burgundy);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}

.sdf-carousel-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sdf-blush);
    margin: 0 0 0.75rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sdf-carousel-photo span {
    color: var(--sdf-terracotta);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sdf-carousel-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sdf-carousel-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--sdf-terracotta);
    font-style: italic;
}

/* Carousel arrows */
.sdf-carousel-wrapper {
    position: relative;
}

.sdf-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--sdf-border);
    background: var(--sdf-white);
    color: var(--sdf-burgundy);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background 0.2s, box-shadow 0.2s;
    line-height: 1;
}

.sdf-carousel-arrow:hover {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sdf-carousel-left {
    left: -16px;
}

.sdf-carousel-right {
    right: -16px;
}

/* ============================================================
   Donor Recognition Grid
   ============================================================ */

.sdf-donor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 2rem auto 0;
    padding: 0 1rem;
}

.sdf-donor-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--sdf-white);
    border: 1px solid var(--sdf-border);
    border-radius: 8px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.sdf-donor-logo:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.sdf-donor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
}

.sdf-donor-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.sdf-donor-type {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sdf-text-muted);
}

@media (max-width: 768px) {
    .sdf-donor-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .sdf-donor-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Endowment Tracker
   ============================================================ */

.sdf-endowment-tracker {
    background: var(--sdf-white);
    border: 1px solid var(--sdf-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

.sdf-endowment-tracker .goal-numbers {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sdf-endowment-tracker .raised {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sdf-burgundy);
}

.sdf-endowment-tracker .goal {
    font-size: 1.1rem;
    color: var(--sdf-text-muted);
}

.sdf-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--sdf-cream);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.sdf-progress-fill {
    height: 100%;
    background: var(--sdf-burgundy);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.sdf-endowment-tracker .match-note {
    font-size: 0.85rem;
    color: var(--sdf-text-muted);
}

/* ============================================================
   Footer — GFI-inspired multi-column
   ============================================================ */

.site-footer {
    background: var(--sdf-burgundy);
    color: var(--sdf-blush);
    padding: 0;
}

/* Override Kadence footer inner padding */
.site-footer .site-bottom-footer-wrap .site-footer-row-container-inner {
    background: var(--sdf-burgundy);
}

.site-footer .footer-html-inner {
    max-width: 100%;
}

.sdf-footer-custom {
    width: 100%;
}

.sdf-footer-custom a {
    color: var(--sdf-rose);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sdf-footer-custom a:hover {
    color: var(--sdf-white);
}

/* 4-column grid — only target div children to avoid wpautop <p> artifacts */
.sdf-footer-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    text-align: left;
    padding: 3rem 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Kill empty wpautop paragraphs inside the grid */
.sdf-footer-columns > p:empty {
    display: none;
}

/* Column headings */
.sdf-col-heading {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sdf-white);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Column 1: Brand */
.sdf-col-brand {
    display: flex;
    flex-direction: column;
}

.sdf-footer-logo {
    max-width: 330px;
    height: auto;
    margin-bottom: 5px;
    filter: brightness(0) saturate(100%) invert(1);
}

.sdf-col-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.85;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.sdf-col-address {
    font-size: 0.85rem;
    opacity: 0.7;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.sdf-col-copyright {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: auto;
}

/* Menu & Quick Links columns */
.sdf-col-menu ul,
.sdf-col-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sdf-col-menu li,
.sdf-col-links li {
    margin-bottom: 0.5rem;
}

.sdf-col-menu a,
.sdf-col-links a {
    font-size: 0.9rem;
}

/* Social media column */
.sdf-social-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sdf-social-links li {
    margin: 0;
}

.sdf-social-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.sdf-social-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sdf-social-links a svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.sdf-social-links a span {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .sdf-footer-columns {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        padding: 2rem 1.5rem 1rem;
    }

    .sdf-col-brand {
        grid-column: 1 / -1;
    }

    .sdf-social-links {
        flex-direction: row;
        gap: 0.75rem;
    }

    .sdf-footer-legal {
        padding: 1rem 1.5rem;
    }

    .sdf-footer-legal a {
        display: inline-block;
        margin: 0.25rem 0.5rem;
    }
}

/* ============================================================
   Members Portal Styles
   ============================================================ */

.sdf-members-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sdf-members-lock::before {
    content: '🔒';
    font-size: 0.85rem;
}

/* WP-Members form styling overrides */
#wpmem_login fieldset,
#wpmem_reg fieldset {
    border: 1px solid var(--sdf-border);
    border-radius: 6px;
    padding: 2rem;
    background: var(--sdf-white);
}

#wpmem_login legend,
#wpmem_reg legend {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--sdf-burgundy);
}

#wpmem_login .button,
#wpmem_reg .button {
    background: var(--sdf-burgundy) !important;
    color: var(--sdf-white) !important;
    border: none !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 4px;
}

#wpmem_login .button:hover,
#wpmem_reg .button:hover {
    background: var(--sdf-burgundy-alt) !important;
}

/* ============================================================
   Leadership — Board Member Grid
   ============================================================ */

.sdf-leadership-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0;
}

.sdf-board-card {
    background: var(--sdf-white);
    border-radius: 8px;
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.sdf-board-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.sdf-board-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--sdf-blush);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sdf-board-photo span {
    color: var(--sdf-terracotta);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sdf-board-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sdf-board-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    color: var(--sdf-burgundy);
    margin: 0 0 0.5rem;
}

.sdf-board-card p {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--sdf-text);
    margin: 0;
}

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

@media (max-width: 480px) {
    .sdf-leadership-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Scroll Animations
   ============================================================ */

/* Hidden until animated */
.sdf-animate {
    opacity: 0;
}

/* Stagger children — each child animates in sequence */
.sdf-animate-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.sdf-animate-stagger.sdf-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Individual element animations */
.sdf-animate-fade {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.sdf-animate-fade.sdf-visible {
    opacity: 1;
    transform: translateY(0);
}

.sdf-animate-slide-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.sdf-animate-slide-left.sdf-visible {
    opacity: 1;
    transform: translateX(0);
}

.sdf-animate-slide-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.sdf-animate-slide-right.sdf-visible {
    opacity: 1;
    transform: translateX(0);
}

.sdf-animate-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.sdf-animate-scale.sdf-visible {
    opacity: 1;
    transform: scale(1);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .sdf-animate,
    .sdf-animate-stagger > *,
    .sdf-animate-fade,
    .sdf-animate-slide-left,
    .sdf-animate-slide-right,
    .sdf-animate-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (max-width: 768px) {
    .sdf-hero {
        padding: 4rem 1.5rem 3rem;
    }

    .sdf-hero h1 {
        font-size: 1.75rem;
    }

    .sdf-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .sdf-card-grid {
        grid-template-columns: 1fr;
    }

    .sdf-section {
        padding: 3rem 1.5rem;
    }

    .sdf-hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .sdf-hero-buttons .sdf-btn {
        width: 100%;
        text-align: center;
    }

    .sdf-donor-carousel {
        gap: 1.5rem;
    }
}

/* ============================================================
   Utility: Container max-width
   ============================================================ */

.sdf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================================
   Print styles
   ============================================================ */

@media print {
    .site-header,
    .site-footer,
    .sdf-hero-buttons {
        display: none;
    }
}

/* ============================================================
   Members Portal — Login Card
   ============================================================ */

.sdf-login-card {
    max-width: 440px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: var(--sdf-white);
    border: 1px solid var(--sdf-border);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.sdf-login-card #sdf-login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sdf-login-card #sdf-login-form p {
    margin-bottom: 1rem;
}

.sdf-login-card #sdf-login-form label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--sdf-burgundy);
    margin-bottom: 0.35rem;
}

.sdf-login-card #sdf-login-form .input,
.sdf-login-card #sdf-login-form input[type="text"],
.sdf-login-card #sdf-login-form input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--sdf-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: var(--sdf-bg-alt);
}

.sdf-login-card #sdf-login-form .input:focus,
.sdf-login-card #sdf-login-form input[type="text"]:focus,
.sdf-login-card #sdf-login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--sdf-burgundy);
    box-shadow: 0 0 0 3px rgba(122, 5, 17, 0.1);
    background: var(--sdf-white);
}

.sdf-login-card #sdf-login-form .login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 1.25rem;
}

.sdf-login-card #sdf-login-form .login-remember label {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--sdf-text);
    margin: 0;
}

.sdf-login-card #sdf-login-form .login-remember input[type="checkbox"] {
    accent-color: var(--sdf-burgundy);
}

.sdf-login-card #sdf-login-form .submit {
    margin-bottom: 0;
}

.sdf-login-card #sdf-login-form #wp-submit {
    width: 100%;
    padding: 0.8rem;
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.sdf-login-card #sdf-login-form #wp-submit:hover {
    background: var(--sdf-burgundy-alt);
}

.sdf-login-card #sdf-login-form #wp-submit:active {
    transform: scale(0.98);
}

.sdf-login-links {
    text-align: center;
    margin-top: 0.75rem;
}

.sdf-login-link {
    color: var(--sdf-burgundy);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}

.sdf-login-link:hover {
    text-decoration: underline;
}

.sdf-login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sdf-border);
}

.sdf-login-footer p {
    margin-bottom: 0.75rem;
    color: var(--sdf-text);
    font-size: 0.9rem;
}

.sdf-btn-alt {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: var(--sdf-burgundy);
    border: 2px solid var(--sdf-burgundy);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.sdf-btn-alt:hover {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
}

.sdf-login-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
}

.sdf-login-note a {
    color: var(--sdf-burgundy);
    text-decoration: none;
    font-weight: 500;
}

/* Registration form styles */
#sdf-register-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sdf-form-row {
    display: flex;
    gap: 1rem;
}

.sdf-form-half {
    flex: 1;
}

.sdf-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sdf-form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--sdf-burgundy);
}

.sdf-required {
    color: #dc3545;
}

#sdf-register-form input[type="text"],
#sdf-register-form input[type="email"],
#sdf-register-form input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--sdf-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: var(--sdf-bg-alt);
}

#sdf-register-form input:focus {
    outline: none;
    border-color: var(--sdf-burgundy);
    box-shadow: 0 0 0 3px rgba(122, 5, 17, 0.1);
    background: var(--sdf-white);
}

.sdf-form-hint {
    font-size: 0.78rem;
    color: #999;
}

.sdf-btn-primary {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    border: none;
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.sdf-btn-primary:hover {
    background: var(--sdf-burgundy-alt);
}

.sdf-btn-primary:active {
    transform: scale(0.98);
}

.sdf-btn-full {
    width: 100%;
}

.sdf-form-error {
    background: #fff5f5;
    border-left: 3px solid #dc3545;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #721c24;
}

.sdf-form-success {
    background: #f0fff4;
    border-left: 3px solid #28a745;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #155724;
}

@media (max-width: 480px) {
    .sdf-form-row {
        flex-direction: column;
        gap: 1rem;
    }
    .sdf-login-card {
        padding: 1.5rem 1.25rem;
    }
}

/* Login page error message */
.sdf-login-card .login #login_error {
    background: #fff5f5;
    border-left: 3px solid #dc3545;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #721c24;
}

.sdf-login-card .login .message {
    background: #f0fff4;
    border-left: 3px solid #28a745;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #155724;
}

/* ============================================================
   AI Chatbot Widget
   ============================================================ */

#sdf-chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    direction: ltr;
}

/* Launcher button */
.sdf-chat-launcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(122, 5, 17, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sdf-chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(122, 5, 17, 0.4);
}

.sdf-chat-launcher-icon { font-size: 1.3rem; }

/* Chat window */
.sdf-chat-window {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-height: 560px;
    background: var(--sdf-white);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--sdf-border);
}

.sdf-chat-open .sdf-chat-window { display: flex; }
.sdf-chat-open .sdf-chat-launcher { display: none; }

/* Header */
.sdf-chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
}

.sdf-chat-header-icon { font-size: 1.5rem; }

.sdf-chat-header-title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.sdf-chat-header-sub {
    font-size: 0.75rem;
    opacity: 0.75;
}

.sdf-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--sdf-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sdf-chat-close:hover { opacity: 1; }

/* Messages */
.sdf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 200px;
    max-height: 320px;
    background: var(--sdf-bg-alt);
}

.sdf-chat-msg {
    display: flex;
    animation: sdfChatFadeIn 0.3s ease;
}

@keyframes sdfChatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sdf-chat-msg-bot { justify-content: flex-start; }
.sdf-chat-msg-user { justify-content: flex-end; }

.sdf-chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.55;
    word-wrap: break-word;
}

.sdf-chat-msg-bot .sdf-chat-bubble {
    background: var(--sdf-white);
    color: var(--sdf-text);
    border: 1px solid var(--sdf-border);
    border-bottom-left-radius: 4px;
}

.sdf-chat-msg-user .sdf-chat-bubble {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    border-bottom-right-radius: 4px;
}

.sdf-chat-bubble a {
    color: var(--sdf-burgundy);
    font-weight: 600;
    text-decoration: underline;
}

.sdf-chat-msg-user .sdf-chat-bubble a {
    color: var(--sdf-cream);
}

/* Suggestions */
.sdf-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--sdf-white);
    border-top: 1px solid var(--sdf-border);
}

.sdf-chat-suggestion {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    background: var(--sdf-cream);
    color: var(--sdf-burgundy);
    border: 1px solid var(--sdf-border);
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.sdf-chat-suggestion:hover {
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    border-color: var(--sdf-burgundy);
}

/* Input row */
.sdf-chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--sdf-white);
    border-top: 1px solid var(--sdf-border);
}

.sdf-chat-input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid var(--sdf-border);
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.sdf-chat-input:focus {
    border-color: var(--sdf-burgundy);
}

.sdf-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sdf-burgundy);
    color: var(--sdf-white);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.sdf-chat-send:hover {
    background: var(--sdf-burgundy-alt);
}

@media (max-width: 480px) {
    #sdf-chatbot { bottom: 12px; right: 12px; }
    .sdf-chat-window {
        width: calc(100vw - 24px);
        right: 0;
        bottom: 70px;
        max-height: 480px;
    }
    .sdf-chat-launcher-text { display: none; }
    .sdf-chat-launcher { padding: 0.75rem; border-radius: 50%; }
}
