/* --- Trinity Falls Farm CSS (Theming v2) --- */

/* =========================================
   1. CSS Custom Properties (Themes & Variables)
   ========================================= */

/* :root defines the default theme (Spring Meadow) */
:root {
    /* Colors */
    --primary-color: #2c5d43;    /* PNW Green */
    --accent-color: #8a4b2c;     /* Rustic Brown */
    --text-color: #333;
    --text-light: #fff;
    --bg-color: #f4f4f4;
    --surface-color: #fff;
    --link-color: #a7d7c5;
    --shadow-color: rgba(0, 0, 0, 0.1);
    /* Typography */
    --heading-font: 'Georgia', serif;
    --body-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Styles */
    --card-border-radius: 5px;
    --card-border: none;
    --bg-image: none;
}

/* Theme 2: Summer / Gold Rush */
body[data-theme="summer"] {
    --primary-color: #c7953c;    /* Golden Ochre */
    --accent-color: #af4425;     /* Terracotta Red */
    --text-color: #4a4a4a;
    --bg-color: #fdfaf5;         /* Dry Grass */
    --link-color: #e88d67;
    --heading-font: 'Arvo', serif; /* Strong Slab Serif */
    --body-font: 'Lato', sans-serif;
    --bg-image: url('/images/textures/subtle-dust.png');
}

/* Theme 3: Autumn / Harvest */
body[data-theme="autumn"] {
    --primary-color: #b3541e;    /* Burnt Orange */
    --accent-color: #5c3d2e;     /* Deep Coffee Brown */
    --text-color: #3d3d3d;
    --bg-color: #f7f1e9;         /* Parchment */
    --link-color: #d88c51;
    --heading-font: 'Merriweather', serif;
    --body-font: 'Lato', sans-serif;
    --bg-image: url('/images/textures/paper.png');
}

/* Theme 4: Winter / Sierra */
body[data-theme="winter"] {
    --primary-color: #4a5c6a;    /* Slate Blue-Gray */
    --accent-color: #9d3a44;     /* Muted Cranberry Red */
    --bg-color: #eef2f5;         /* Cool Snowdrift */
    --link-color: #8aa3b5;
    --heading-font: 'Oswald', sans-serif; /* Strong, condensed sans-serif */
    --body-font: 'Open Sans', sans-serif;
    --card-border-radius: 0px; /* Sharp corners */
    --card-border: 1px solid #ddd;
    --bg-image: none;
}


/* =========================================
   2. General Styles (Now using all Variables)
   ========================================= */

body {
    font-family: var(--body-font);
    margin: 0;
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* --- Header & Navigation --- */
header {
    background: var(--surface-color);
    color: var(--text-color);
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: var(--heading-font);
    font-weight: normal;
    color: var(--primary-color);
}
a.logo-link { text-decoration: none; }
header nav ul { list-style: none; padding: 0; margin: 0; display: flex; }
header nav ul li { margin-left: 20px; }
header nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}
header nav a:hover { color: var(--accent-color); }
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px var(--shadow-color);
    z-index: 1001; 
    border-radius: 8px;
    overflow: hidden;
}
.dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; }
.dropdown-content a:hover { background-color: #f1f1f1 }
.dropdown:hover .dropdown-content { display: block; }

/* --- Hero Section --- */
#hero { position: relative; height: 70vh; color: var(--text-light); text-align: center; display: flex; justify-content: center; align-items: center; }
#hero .hero-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; }
#hero img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); }
#hero .hero-text { position: relative; z-index: 1; text-shadow: 0px 2px 6px rgba(0, 0, 0, 0.9); background: rgba(0, 0, 0, 0.2); padding: 1.5rem 2rem; border-radius: 5px; }
#hero h2 { font-size: 3rem; margin-bottom: 0.5rem; font-family: var(--heading-font); }

/* --- Sections & Cards --- */
main section { padding: 4rem 0; border-bottom: 1px solid #ddd; }
main section:last-child { border-bottom: none; }
.page-header { text-align: center; padding-bottom: 2rem; border-bottom: 1px solid #ddd; margin-bottom: 2rem; }
.page-header h1 { font-family: var(--heading-font); font-size: 2.8rem; color: var(--primary-color); }
.animal-grid, .product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.animal-card, .product-card {
    background: var(--surface-color);
    border-radius: var(--card-border-radius);
    border: var(--card-border);
    box-shadow: 0 2px 5px var(--shadow-color);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.animal-card:hover, .product-card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.animal-card img, .product-card img { width: 100%; height: 200px; object-fit: cover; }
.animal-card h3, .product-card h3 { padding: 1rem 1rem 0 1rem; font-family: var(--heading-font); }
.animal-card p, .product-card p { padding: 0 1rem; flex-grow: 1; }
.animal-card .button-secondary { margin: 1rem; }
.shop-link { text-align: center; margin-top: 2rem; }

/* --- Buttons --- */
.button { display: inline-block; background: var(--primary-color); color: var(--text-light); padding: 12px 24px; text-decoration: none; border-radius: 5px; margin-top: 1rem; transition: background-color 0.3s ease; }
.button:hover { background: var(--accent-color); }
.button-secondary { display: inline-block; background: transparent; color: var(--primary-color); padding: 10px 20px; text-decoration: none; border: 2px solid var(--primary-color); border-radius: 5px; transition: background-color 0.3s ease, color 0.3s ease; }
.button-secondary:hover { background: var(--primary-color); color: var(--text-light); }

/* --- Specific Section Styles --- */
#mission-content { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.mission-image, .mission-text { flex: 1 1 300px; }
.mission-image img { width: 100%; border-radius: 5px; }
.side-by-side { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.text-content { flex: 1.5 1 300px; }
.image-content { flex: 1 1 300px; }
.image-content img { width: 100%; border-radius: 5px; }
.animal-details { display: flex; flex-direction: column; gap: 1.5rem; }
.animal-image-large img { width: 100%; max-height: 500px; object-fit: cover; border-radius: 5px; }
.shopify-placeholder { border: 2px dashed #ccc; padding: 3rem; text-align: center; background: #fafafa; margin-top: 2rem; }

/* --- Footer --- */
footer { background: var(--text-color); color: var(--text-light); text-align: center; padding: 2rem 0; }
footer a { color: var(--link-color); text-decoration: none; }

/* --- Animations --- */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.page-fade-in { animation: fadeInAnimation 0.8s ease-in forwards; }
@keyframes fadeInAnimation { from { opacity: 0; } to { opacity: 1; } }

/* --- ADMIN PAGE TABS & UI --- */
.tab-nav { display: flex; border-bottom: 2px solid #ccc; margin-bottom: 2rem; }
.tab-button { padding: 1rem 1.5rem; border: none; background-color: transparent; cursor: pointer; font-size: 1rem; color: #555; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s ease-in-out; }
.tab-button:hover { background-color: #f4f4f4; color: #333; }
.tab-button.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: bold; }
.tab-panels-container > .tab-content { display: none; }
.tab-panels-container > .tab-content.active { display: block; }
.form-group-toggle { display: flex; align-items: center; justify-content: space-between; max-width: 400px; }
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e06c75; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--primary-color); }
input:focus + .slider { box-shadow: 0 0 1px var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }
.post-title-link { text-decoration: none; color: inherit; }
.post-title-link:hover h2 { color: var(--accent-color); }
.post-title-button { background: none; border: none; padding: 0; margin: 0; text-align: left; cursor: pointer; width: 100%; }
.post-summary, .post-full-content { transition: opacity 0.3s ease-in-out; }
.post-full-content { display: none; }
.blog-post-summary.expanded .post-summary { display: none; }
.blog-post-summary.expanded .post-full-content { display: block; }
.more-link { color: var(--accent-color); font-weight: bold; cursor: pointer; }
.post-title-button, .post-summary-clickable { cursor: pointer; }

/* --- Mobile Navigation & Responsive Styles --- */
.mobile-nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0; z-index: 1000; }
@media (max-width: 768px) {
    #hero h2 { font-size: 2.2rem; }
    header .container { flex-direction: row; position: relative; }
    .mobile-nav-toggle { display: block; }
    header nav ul { display: none; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%; 
        right: 0; 
        background-color: var(--surface-color);
        border: 1px solid #ccc;
        box-shadow: 0 4px 8px var(--shadow-color);
        padding: 1rem;
        width: 250px;
        margin-top: 5px;
        border-radius: 8px;
        overflow: hidden;
    }
    .main-nav.nav-active ul { display: flex; }
    .main-nav li { margin: 0.5rem 0; width: 100%; }
    .main-nav .dropdown-content { position: static; display: block; background-color: transparent; box-shadow: none; border: none; padding-left: 1rem; }
    .main-nav .dropdown-content a { padding: 8px 10px; }
}