/*
Theme Name: Ballina Info Theme
Theme URI: http://ballina.info/
Author: Ballina Info
Description: Local community and tourism guide for Ballina, NSW Australia
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ballina-info
Tags: custom-menu, featured-images, translation-ready
*/

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1A6FB4;
    --accent: #3AAA8A;
    --dark: #0D3F6E;
    --light-bg: #F5F7FA;
    --white: #FFFFFF;
    --text: #2D3436;
    --muted: #636E72;
    --border: #DFE6E9;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --max-width: 1200px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
}

h1 { font-size: 2.2rem; margin-bottom: 1rem; }
h2 { font-size: 1.7rem; margin-bottom: 0.8rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* === Header === */
.site-header {
    background: var(--white);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

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

/* === Navigation === */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
}

.main-nav li { position: relative; }

.main-nav a {
    display: block;
    padding: 0.5rem 0.8rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-page-ancestor > a {
    background: var(--primary);
    color: var(--white);
}

.main-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-hover);
    border-radius: var(--radius);
    min-width: 220px;
    z-index: 200;
    padding: 0.5rem 0;
}

.main-nav li:hover > .sub-menu { display: block; }

.main-nav .sub-menu a {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 0;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 1.2rem;
    cursor: pointer;
}

/* === Hero Section === */
.hero {
    position: relative;
    background: var(--dark);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero h1 { color: var(--white); font-size: 2.6rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 1.5rem; }

/* === Page Hero === */
.page-hero {
    position: relative;
    height: 300px;
    background: var(--dark);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-hero img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.page-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 0 1.5rem;
}

.page-hero h1 { color: var(--white); font-size: 2.4rem; }

/* === Sections === */
.section { padding: 3rem 0; }
.section-alt { background: var(--light-bg); }
.section-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* === Card Grid === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card-img {
    height: 200px;
    overflow: hidden;
}

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

.card:hover .card-img img { transform: scale(1.05); }

.card-body { padding: 1.2rem; }
.card-body h3 { margin-bottom: 0.4rem; }
.card-body h3 a { color: var(--dark); }
.card-body h3 a:hover { color: var(--primary); }
.card-body p { color: var(--muted); font-size: 0.9rem; }

.card-link {
    display: inline-block;
    margin-top: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.card-link::after { content: ' \2192'; }

/* === Content === */
.content-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.content-area h2 { margin-top: 2rem; color: var(--primary); }
.content-area h3 { margin-top: 1.5rem; }
.content-area p { margin-bottom: 1rem; }
.content-area ul, .content-area ol { margin: 1rem 0 1rem 1.5rem; }
.content-area li { margin-bottom: 0.4rem; }

.content-area blockquote {
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    background: var(--light-bg);
    margin: 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* === FAQ === */
.faq-section { margin-top: 2.5rem; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.8rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: var(--light-bg);
    border: none;
    padding: 1rem 1.2rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--dark);
    font-family: 'Nunito', sans-serif;
}

.faq-question::after { content: '+'; font-size: 1.3rem; color: var(--accent); }
.faq-item.active .faq-question::after { content: '\2212'; }

.faq-answer {
    padding: 0 1.2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 1rem 1.2rem;
}

/* === Blog === */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.post-meta {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

/* === Breadcrumbs === */
.breadcrumbs {
    padding: 0.8rem 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.breadcrumbs a { color: var(--primary); }
.breadcrumbs span { margin: 0 0.3rem; }

/* === Footer === */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.8);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* === Sidebar Layout === */
.with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.sidebar .widget {
    background: var(--light-bg);
    padding: 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.sidebar .widget h4 {
    margin-bottom: 0.8rem;
    color: var(--primary);
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
    border: none;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--dark); color: var(--white); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: #2E9177; color: var(--white); }

/* === Quick Links Grid (Homepage) === */
.quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.quick-link {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    color: var(--white);
    font-weight: 600;
    transition: background 0.2s;
}

.quick-link:hover {
    background: rgba(255,255,255,0.25);
    color: var(--white);
}

/* === Areas Grid === */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.area-card {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.area-card:hover { transform: translateY(-3px); }
.area-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.area-card p { font-size: 0.85rem; color: var(--muted); }

/* === Responsive === */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav ul { display: none; flex-direction: column; width: 100%; }
    .main-nav.active ul { display: flex; }
    .main-nav .sub-menu { position: static; box-shadow: none; padding-left: 1rem; }
    .main-nav li:hover > .sub-menu { display: none; }
    .main-nav li.open > .sub-menu { display: block; }

    .hero h1 { font-size: 1.8rem; }
    .quick-links { grid-template-columns: repeat(2, 1fr); }
    .areas-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: 1fr; }
    .with-sidebar { grid-template-columns: 1fr; }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .quick-links { grid-template-columns: 1fr; }
    .areas-grid { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; }
}
