/* ==========================================================================
   1. GLOBAL VARIABLES & CONFIG
   ========================================================================== */

/* Custom Typography Import */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Source+Sans+3:wght@300;400;600&display=swap');

:root {
    /* Color Palette */
    --bg-dark-matte: #0d0f12;     /* Ren, matt mörksvart för hela sajten */
    --bg-nav: rgba(18, 21, 26, 0.6);
    --bg-footer: #060709;
    --bg-card-body: #ffffff;      /* Krispigt vit bakgrund för stuteri-korten */
    --bg-cover-placeholder: #161920;
    
    /* Accents & Brand Colors */
    --gold-regal: #dfc489;        /* Premium dämpad guldton för titlar & länkar */
    --gold-alpha: rgba(223, 196, 137, 0.9);
    --gold-alpha-border: rgba(223, 196, 137, 0.3);
    --gold-alpha-bg: rgba(223, 196, 137, 0.05);
    --brand-primary: #059669;     /* Smaragdgrön för publika element/knappar */
    --brand-hover: #047857;
    
    /* Text Colors */
    --text-light: #f4f1ea;        /* Ljus krämvit för den mörka bakgrunden */
    --text-nav-link: #d1d5db;
    --text-muted: #6b7280;         /* Gråton för undertitlar */
    --text-card-dark: #111111;    /* Mörk text inuti de vita korten */
    --text-card-muted: #444444;   /* Dämpad brödtext inuti korten */
    --text-footer-muted: #4b5563;
    --text-copyright: #374151;
    
    /* Borders & Lines */
    --border-nav: rgba(17, 24, 39, 0.8);
    --border-card-frame: #333333; /* Mörk estetisk ram runt korten */
    --border-footer: #111827;
    
    /* Shadows & Animations */
    --shadow-card-normal: 0 15px 35px -5px rgba(0, 0, 0, 0.5);
    --shadow-card-hover: 0 25px 40px -10px rgba(0, 0, 0, 0.7);
    --shadow-badge: 0 6px 15px rgba(0, 0, 0, 0.25);
    --transition-smooth: 0.2s ease;
    --transition-card: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: var(--bg-dark-matte);
    color: var(--text-light);
    margin: 0;
}

h1, h2, h3, .font-serif {
    font-family: 'Cinzel', serif;
}


/* ==========================================================================
   2. PUBLIC HEADER NAVIGATION
   ========================================================================== */
.public-nav {
    border-bottom: 1px solid var(--border-nav);
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 1.5rem;
}
.public-nav-container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.public-nav-brand {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    transition: color var(--transition-smooth);
}
.public-nav-brand:hover {
    color: var(--gold-regal);
}
.public-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.public-nav-link {
    color: var(--text-nav-link);
    text-decoration: none;
    transition: color var(--transition-smooth);
}
.public-nav-link:hover {
    color: #ffffff;
}
.public-nav-btn-admin {
    border: 1px solid var(--gold-alpha-border);
    color: var(--gold-alpha);
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    text-decoration: none;
    background-color: var(--gold-alpha-bg);
    transition: border-color var(--transition-smooth), color var(--transition-smooth);
}
.public-nav-btn-admin:hover {
    border-color: var(--gold-regal);
    color: var(--gold-regal);
}


/* ==========================================================================
   3. CINEMATIC LANDING PAGE BANNER
   ========================================================================== */
.public-hero {
    text-align: center;
    padding: 4rem 1rem 2rem 1rem;
    max-width: 64rem;
    margin: 0 auto;
}
.public-hero-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold-regal);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.public-hero-subtitle {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}


/* ==========================================================================
   4. LAYOUT STRUCTURE & GRID
   ========================================================================== */
.public-main-content {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem 1.5rem;
}
.public-empty-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.stables-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 2.5rem;
}
@media (min-width: 768px) { .stables-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .stables-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }


/* ==========================================================================
   5. PREMIUM CARD ARCHITECTURE
   ========================================================================== */
.stable-card {
    background-color: var(--bg-card-body);
    border-radius: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    position: relative;
    box-shadow: var(--shadow-card-normal);
    transition: transform var(--transition-card), box-shadow var(--transition-card);
    border: 4px solid var(--border-card-frame);
    margin-bottom: 0.25rem;
}
.stable-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.stable-card-cover {
    position: relative;
    height: 10rem;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-cover-placeholder);
}
.stable-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stable-card-body {
    position: relative;
    padding: 4.5rem 1.5rem 1.5rem 1.5rem;
    background-color: var(--bg-card-body);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stable-card-badge-wrap {
    position: absolute;
    top: 10rem;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 9rem;
    height: 9rem;
    border-radius: 9999px;
    background-color: var(--bg-card-body);
    padding: 0.25rem;
    box-shadow: var(--shadow-badge);
    z-index: 10;
}
.stable-card-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 9999px;
}

.stable-card-text-center {
    text-align: center;
}
.stable-card-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-card-dark);
    margin: 0 0 0.25rem 0;
}
.stable-card-desc {
    color: var(--text-card-muted);
    font-size: 0.935rem;
    line-height: 1.6;
    font-weight: 400;
    margin: 0 0 0.25rem 0;
}
.stable-card-action {
    display: inline-block;
    font-size: 0.812rem;
    color: var(--text-card-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}


/* ==========================================================================
   6. PUBLIC TABLES (FOR HORSE LISTS & RESULTS)
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background-color: rgba(18, 21, 26, 0.4);
    border: 1px solid var(--border-card-frame);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}
.public-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.public-table th {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-card-frame);
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gold-regal);
}
.public-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
    vertical-align: middle;
}
.public-table tr:last-child td {
    border-bottom: 0;
}
.public-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Public Typography Details */
.public-horse-name { font-weight: 700; color: #ffffff; font-size: 0.95rem; }
.public-subinfo { font-size: 0.75rem; color: var(--text-nav-link); line-height: 1.4; }
.public-stable-badge {
    font-size: 0.75rem;
    background-color: rgba(223, 196, 137, 0.1);
    color: var(--gold-regal);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--gold-alpha-border);
    white-space: nowrap;
}


/* ==========================================================================
   7. PUBLIC FOOTER SECTION
   ========================================================================== */
.public-footer {
    border-top: 1px solid var(--border-footer);
    background-color: var(--bg-footer);
    padding: 3rem 1.5rem;
    margin-top: 3rem;
}
.public-footer-container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .public-footer-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
.public-footer-brand-title {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.15em;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    margin: 0;
}
.public-footer-brand-tagline {
    font-size: 0.75rem;
    color: var(--text-footer-muted);
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
.public-footer-copyright {
    font-size: 0.75rem;
    color: var(--text-copyright);
    font-weight: 500;
    letter-spacing: 0.025em;
}
@media (min-width: 768px) { .public-footer-copyright { text-align: right; } }
.public-footer-copyright-sub {
    margin-top: 0.25rem;
    color: var(--gold-regal);
}


/* ==========================================================================
   8. COOKIE NOTICE BANNER
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1f2937;
    color: #ffffff;
    padding: 1rem;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    font-family: sans-serif;
    transition: all 0.3s ease-in-out;
}
.cookie-banner.hidden {
    display: none;
}
.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
@media (min-width: 768px) {
    .cookie-content {
        flex-direction: row;
    }
}
.cookie-content p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #e5e7eb;
}
.cookie-btn {
    background-color: var(--brand-primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}
.cookie-btn:hover {
    background-color: var(--brand-hover);
}