/*
 * ================================================================
 * STYLE.CSS — THE MOST IMPORTANT FILE IN YOUR WORDPRESS THEME
 * ================================================================
 *
 * This file does TWO things:
 *
 * 1. The comment block at the top (what you're reading now) tells
 *    WordPress "hey, this folder is a theme!" — WordPress reads
 *    this info and shows it in Appearance > Themes in your dashboard.
 *    WITHOUT this comment block, WordPress won't see your theme.
 *
 * 2. Everything below the comment block is your CSS — the styles
 *    that control how your website LOOKS (colours, fonts, layout etc.)
 *
 * ================================================================
 * THEME INFORMATION BLOCK — WordPress reads this automatically
 * ================================================================
 *
 Theme Name:  Orisha Tales
 Theme URI:   https://itanorisa.uk
 Author:      Bimbo Adeyemi
 Description: A custom WordPress theme for Orisha Tales — stories of the Yoruba gods.
 Version:     1.0
 Tags:        mythology, storytelling, custom
 *
 */


/* ================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ================================================================
   Think of these like named colours/values you can reuse anywhere.
   If you want to change your main colour, you only change it HERE
   and it updates everywhere on the site automatically.
   ================================================================ */

:root {
    --colour-bg:         #1a1208;   /* Very dark brown — main page background */
    --colour-surface:    #2c1f0e;   /* Slightly lighter brown — cards, sections */
    --colour-primary:    #c8752a;   /* Burnt orange — buttons, highlights */
    --colour-secondary:  #e8b96a;   /* Warm gold — headings, accents */
    --colour-text:       #f0e6d3;   /* Cream — main body text */
    --colour-text-muted: #a08060;   /* Muted tan — secondary text, captions */
    --colour-border:     #4a3520;   /* Dark brown — borders, dividers */

    --font-heading: 'Georgia', serif;       /* Font for headings — serif feels ancient/epic */
    --font-body:    'Helvetica', sans-serif; /* Font for body text — clean and readable */

    --max-width: 1200px;   /* Maximum width the content will stretch to */
    --spacing-sm: 1rem;    /* Small spacing unit (16px) */
    --spacing-md: 2rem;    /* Medium spacing unit (32px) */
    --spacing-lg: 4rem;    /* Large spacing unit (64px) */
}


/* ================================================================
   RESET / BASE STYLES
   ================================================================
   Browsers add their own default styles (margins, paddings etc.)
   that differ between Chrome, Firefox, Safari etc.
   This "reset" removes those defaults so we start from a clean slate.
   ================================================================ */

/* The * selector means "apply this to EVERYTHING on the page" */
*, *::before, *::after {
    margin: 0;           /* Remove default margins */
    padding: 0;          /* Remove default padding */
    box-sizing: border-box; /* Makes width/height include padding — much easier to work with */
}

/* Base styles for the whole page */
body {
    background-color: var(--colour-bg);   /* Dark brown background */
    color: var(--colour-text);            /* Cream text */
    font-family: var(--font-body);        /* Default font for all text */
    font-size: 1rem;                      /* 16px base font size */
    line-height: 1.7;                     /* Space between lines — 1.7 is comfortable to read */
}

/* Make all images responsive by default */
img {
    max-width: 100%;   /* Image will never be wider than its container */
    height: auto;      /* Height adjusts proportionally */
    display: block;    /* Removes the small gap that appears under inline images */
}

/* Remove bullet points from all lists by default */
ul, ol {
    list-style: none;
}

/* Remove underline from all links by default */
a {
    text-decoration: none;
    color: inherit; /* Links inherit the colour of their parent element */
}


/* ================================================================
   TYPOGRAPHY — HEADINGS AND TEXT STYLES
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);  /* Serif font for all headings */
    color: var(--colour-secondary);    /* Gold colour for headings */
    line-height: 1.2;                  /* Tighter line height for large text */
    margin-bottom: var(--spacing-sm);  /* Space below every heading */
}

h1 { font-size: clamp(2rem, 5vw, 4rem); }   /* clamp = min, preferred, max size */
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }

p {
    margin-bottom: var(--spacing-sm); /* Space below each paragraph */
    color: var(--colour-text);
}


/* ================================================================
   UTILITY CLASSES
   ================================================================
   Small reusable classes you can add to any element in your HTML.
   e.g. <div class="container"> will centre and constrain the content.
   ================================================================ */

/* Centres content and limits max width */
.container {
    width: 90%;                   /* 90% of the viewport width */
    max-width: var(--max-width);  /* But never wider than 1200px */
    margin: 0 auto;               /* auto left/right margin = centred */
}

/* Section padding — adds breathing room above and below sections */
.section-padding {
    padding: var(--spacing-lg) 0;
}

/* Text alignment helpers */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }


/* ================================================================
   BUTTONS
   ================================================================ */

/* Base button style — applies to ALL buttons */
.btn {
    display: inline-block;           /* Allows padding/width on an <a> tag */
    padding: 0.75rem 2rem;           /* Top/bottom 12px, left/right 32px */
    border-radius: 4px;              /* Slightly rounded corners */
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;                 /* Shows pointer cursor on hover */
    border: 2px solid transparent;  /* Border exists but is transparent by default */
    transition: all 0.3s ease;      /* Smooth animation for hover effects */
    text-transform: uppercase;       /* ALL CAPS text */
    letter-spacing: 0.05em;         /* Slight spacing between letters */
}

/* Primary button — main call to action */
.btn-primary {
    background-color: var(--colour-primary); /* Burnt orange background */
    color: #fff;
    border-color: var(--colour-primary);
}

/* What happens when you hover over the primary button */
.btn-primary:hover {
    background-color: transparent;          /* Background disappears */
    color: var(--colour-primary);           /* Text becomes orange */
    border-color: var(--colour-primary);    /* Orange border stays */
}

/* Secondary button — less prominent action */
.btn-secondary {
    background-color: transparent;
    color: var(--colour-secondary);          /* Gold text */
    border-color: var(--colour-secondary);   /* Gold border */
}

.btn-secondary:hover {
    background-color: var(--colour-secondary);
    color: var(--colour-bg);  /* Dark text on gold background */
}


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

/* The <header> element wraps the entire navigation bar */
.site-header {
    position: fixed;        /* Sticks to the top as you scroll */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;          /* Sits above everything else on the page */
    background-color: rgba(26, 18, 8, 0.95); /* Semi-transparent dark brown */
    border-bottom: 1px solid var(--colour-border);
    padding: 1rem 0;
}

/* Flexbox layout for the nav — logo on left, links on right */
.nav-inner {
    display: flex;
    align-items: center;        /* Vertically centres logo and links */
    justify-content: space-between; /* Pushes logo left, links right */
}

/* The site logo/name */
.site-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--colour-secondary); /* Gold */
    font-weight: bold;
    letter-spacing: 0.05em;
}

.site-logo:hover {
    color: var(--colour-primary); /* Orange on hover */
}

/* The list of navigation links */
.nav-menu {
    display: flex;   /* Puts the nav items in a horizontal row */
    gap: 2rem;       /* Space between each nav item */
}

/* Each individual nav link */
.nav-menu a {
    color: var(--colour-text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.3s ease;
    position: relative; /* Needed for the underline animation below */
}

/* Animated underline effect on nav links */
.nav-menu a::after {
    content: '';             /* Creates an empty pseudo-element */
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;                /* Starts with 0 width (invisible) */
    height: 2px;
    background-color: var(--colour-primary);
    transition: width 0.3s ease; /* Animates the width change */
}

/* When hovering, the underline grows to full width */
.nav-menu a:hover::after {
    width: 100%;
}

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


/* ================================================================
   HERO SECTION
   ================================================================
   The big banner at the top of the page with a background image,
   large heading, and call-to-action buttons.
   ================================================================ */

.hero {
    min-height: 100vh;          /* At least as tall as the viewport */
    display: flex;
    align-items: center;        /* Vertically centres the content */
    justify-content: center;
    text-align: center;
    position: relative;         /* Needed for the overlay below */

    /* Background image — replace this URL with your own image */
    background-image: url('images/hero-bg.jpg');
    background-size: cover;     /* Image covers the whole area */
    background-position: center center;
    background-attachment: fixed; /* Parallax scroll effect */
}

/* Dark overlay on top of the hero image so text is readable */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;  /* Shorthand for top:0, right:0, bottom:0, left:0 */
    background: linear-gradient(
        to bottom,
        rgba(26, 18, 8, 0.7) 0%,   /* Darker at top */
        rgba(26, 18, 8, 0.5) 50%,  /* Slightly lighter in middle */
        rgba(26, 18, 8, 0.9) 100%  /* Very dark at bottom */
    );
}

/* The actual hero text content sits above the overlay */
.hero-content {
    position: relative;  /* z-index only works on positioned elements */
    z-index: 1;          /* Sits above the ::before overlay */
    max-width: 800px;
    padding: var(--spacing-md);
}

.hero-subtitle {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--colour-primary);
    margin-bottom: var(--spacing-sm);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 20px rgba(0,0,0,0.5); /* Subtle shadow for depth */
}

.hero-description {
    font-size: 1.1rem;
    color: var(--colour-text-muted);
    max-width: 600px;
    margin: 0 auto var(--spacing-md);
}

/* Two buttons side by side */
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap; /* Buttons stack on small screens */
}


/* ================================================================
   ABOUT / INTRO SECTION
   ================================================================ */

.about-section {
    background-color: var(--colour-surface);
}

/* Two column layout — text on left, image on right */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: var(--spacing-md);
    align-items: center;
}

.about-image {
    border-radius: 8px;
    border: 3px solid var(--colour-border);
    overflow: hidden; /* Keeps the image inside the rounded border */
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover; /* Crops image to fill the space without stretching */
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05); /* Subtle zoom on hover */
}

.section-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--colour-primary);
    margin-bottom: 0.5rem;
}


/* ================================================================
   FEATURED STORIES SECTION (CARDS)
   ================================================================ */

.stories-section {
    background-color: var(--colour-bg);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-header p {
    color: var(--colour-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* CSS Grid for the card layout — 3 cards in a row */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
    gap: var(--spacing-sm);
}

/* Individual story card */
.story-card {
    background-color: var(--colour-surface);
    border-radius: 8px;
    border: 1px solid var(--colour-border);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.story-card:hover {
    transform: translateY(-8px);  /* Card floats up on hover */
    border-color: var(--colour-primary);
}

/* Image area at the top of the card */
.card-image {
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-card:hover .card-image img {
    transform: scale(1.1);
}

.card-body {
    padding: var(--spacing-sm);
}

/* Small category tag on the card */
.card-tag {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--colour-primary);
    border: 1px solid var(--colour-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--colour-text-muted);
    margin-bottom: var(--spacing-sm);
}

.card-link {
    font-size: 0.85rem;
    color: var(--colour-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: bold;
    transition: color 0.3s ease;
}

.card-link:hover {
    color: var(--colour-secondary);
}


/* ================================================================
   CALL TO ACTION SECTION
   ================================================================ */

.cta-section {
    background-color: var(--colour-surface);
    border-top: 1px solid var(--colour-border);
    border-bottom: 1px solid var(--colour-border);
    text-align: center;
}

.cta-section h2 {
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--colour-text-muted);
    max-width: 500px;
    margin: 0 auto var(--spacing-md);
}


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

.site-footer {
    background-color: #0f0a04; /* Even darker than the main bg */
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--colour-border);
}

/* Three column footer layout */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* Left column is wider */
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.footer-brand p {
    color: var(--colour-text-muted);
    font-size: 0.9rem;
    max-width: 300px;
    margin-top: 0.5rem;
}

.footer-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--colour-secondary);
    margin-bottom: 1rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--colour-text-muted);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--colour-primary);
}

/* Bottom bar with copyright */
.footer-bottom {
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--colour-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--colour-text-muted);
    font-size: 0.85rem;
    margin: 0;
}


/* ================================================================
   RESPONSIVE — MOBILE STYLES
   ================================================================
   @media queries apply styles ONLY when the screen is a certain size.
   "max-width: 768px" means "on screens 768px wide or smaller" (tablets/phones).
   We override our desktop styles here to stack things vertically.
   ================================================================ */

@media (max-width: 768px) {

    /* Hide nav links on mobile — you'd need JS for a hamburger menu */
    .nav-menu {
        display: none;
    }

    /* Stack about section vertically on mobile */
    .about-grid {
        grid-template-columns: 1fr; /* Single column */
    }

    /* Stack image below text on mobile */
    .about-image {
        order: -1; /* Moves image above the text */
    }

    /* Single column cards on mobile */
    .stories-grid {
        grid-template-columns: 1fr;
    }

    /* Single column footer on mobile */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Medium screens — 2 column cards on tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
