/*
 Theme Name:   Dorstone Settlement Timeline
 Theme URI:    https://dorstonesettlement.org
 Description:  Custom child theme for the Dorstone Settlement Timeline project. Built on GeneratePress.
 Author:       Dorstone Settlement Timeline Project
 Author URI:   https://dorstonesettlement.org
 Template:     generatepress
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  dst-theme
*/

/* ============================================
   DORSTONE SETTLEMENT TIMELINE
   Brand Identity Stylesheet
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Brand colours */
    --dst-terracotta: #A63D2F;
    --dst-terracotta-light: #C25A4C;
    --dst-terracotta-dark: #8A3226;
    --dst-charcoal: #3D4A4F;
    --dst-charcoal-light: #5A6A70;
    --dst-sienna: #9B7352;
    --dst-sage: #6B7B5E;
    --dst-sage-light: #8A9B7C;
    --dst-tan-gold: #A09478;
    --dst-cream: #F0EBE0;
    --dst-cream-dark: #E5DFD1;
    --dst-white: #FFFFFF;
    --dst-black: #1A1A1A;

    /* Typography */
    --dst-heading-font: 'DM Sans', 'Arial', sans-serif;
    --dst-body-font: 'Cormorant Garamond', 'Georgia', serif;
    --dst-ui-font: 'DM Sans', 'Arial', sans-serif;

    /* Spacing */
    --dst-section-padding: 80px;
    --dst-content-width: 1200px;
    --dst-narrow-width: 800px;
}

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* --- Break out of GeneratePress container --- */
.full-width-content #page.grid-container,
.full-width-content #page.container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
}

.full-width-content #content.site-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* --- Base Typography --- */
body {
    font-family: var(--dst-body-font);
    font-size: 20px;
    line-height: 1.7;
    color: var(--dst-charcoal);
    background-color: var(--dst-white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--dst-heading-font);
    font-weight: 700;
    color: var(--dst-charcoal);
    line-height: 1.2;
}

h1 { font-size: 3rem; margin-bottom: 0.5em; }
h2 { font-size: 2.4rem; margin-bottom: 0.5em; }
h3 { font-size: 1.8rem; margin-bottom: 0.4em; }
h4 { font-size: 1.4rem; margin-bottom: 0.4em; }

p {
    margin-bottom: 1.2em;
}

/* --- Links --- */
a {
    color: var(--dst-terracotta);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--dst-terracotta-dark);
    text-decoration: underline;
}

/* --- Custom Header (dst-header) --- */
.dst-header {
    background-color: var(--dst-charcoal);
    border-bottom: 3px solid var(--dst-terracotta);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dst-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--dst-content-width);
    margin: 0 auto;
    padding: 8px 40px;
    box-sizing: border-box;
}

/* Header logo */
.dst-header-logo a {
    display: block;
    line-height: 0;
}

.dst-header-logo img {
    height: 70px;
    width: auto;
    display: block;
}

/* Navigation */
.dst-nav {
    margin-left: auto;
}

.dst-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.dst-nav ul li {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.dst-nav ul li a {
    display: block;
    font-family: var(--dst-ui-font);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--dst-cream);
    padding: 10px 15px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.dst-nav ul li a:hover,
.dst-nav ul li a:focus {
    color: var(--dst-terracotta-light);
    text-decoration: none;
}

.dst-nav ul li.current-menu-item > a,
.dst-nav ul li.current_page_item > a,
.dst-nav ul li.current-menu-ancestor > a {
    color: var(--dst-terracotta-light);
}

/* Dropdown sub-menus */
.dst-nav ul ul {
    display: none;
    position: absolute;
    flex-direction: column;
    background-color: var(--dst-charcoal-light);
    border: 1px solid rgba(240,235,224,0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    min-width: 200px;
    z-index: 200;
    left: 0;
    top: 100%;
}

.dst-nav ul li:hover > ul {
    display: flex;
}

.dst-nav ul ul li {
    width: 100%;
}

.dst-nav ul ul li a {
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 8px 15px;
}

/* Mobile menu toggle — hidden on desktop */
.dst-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-family: var(--dst-ui-font);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dst-cream);
    cursor: pointer;
    padding: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dst-menu-toggle-icon {
    font-size: 1.2rem;
    margin-right: 5px;
}

/* Remove any white gap between header and page content */
.site-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.inside-article,
.entry-content,
.content-area {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.page-header,
.entry-header {
    margin: 0 !important;
    padding: 0 !important;
}

.page-template-default .inside-article,
.post-type-archive .inside-article,
.tax-dst_era .inside-article,
.tax-dst_gallery_cat .inside-article {
    padding: 0 !important;
    margin: 0 !important;
}

/* --- Hero Section --- */
.dst-hero {
    background-color: var(--dst-cream);
    color: var(--dst-charcoal);
    padding: 120px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.dst-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(240,235,224,0.9) 0%, rgba(240,235,224,0.95) 100%);
    z-index: 1;
}

.dst-hero-content {
    position: relative;
    z-index: 2;
    max-width: var(--dst-narrow-width);
    margin: 0 auto;
}

.dst-hero-logo {
    max-width: 280px;
    margin-bottom: 30px;
}

.dst-hero h1 {
    color: var(--dst-charcoal);
    font-size: 3.5rem;
    margin-bottom: 0.3em;
    letter-spacing: -0.01em;
}

.dst-hero .dst-strapline {
    font-family: var(--dst-body-font);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--dst-sienna);
    margin-bottom: 1.5em;
}

.dst-hero .dst-tagline {
    font-family: var(--dst-heading-font);
    font-size: 1.1rem;
    color: var(--dst-charcoal);
    opacity: 0.6;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Buttons --- */
.dst-btn {
    display: inline-block;
    font-family: var(--dst-ui-font);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 32px;
    border-radius: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.dst-btn-primary {
    background-color: var(--dst-terracotta);
    color: var(--dst-white);
}

.dst-btn-primary:hover {
    background-color: var(--dst-terracotta-dark);
    color: var(--dst-white);
    text-decoration: none;
}

.dst-btn-secondary {
    background-color: transparent;
    color: var(--dst-charcoal);
    border: 2px solid var(--dst-charcoal);
}

.dst-btn-secondary:hover {
    background-color: var(--dst-charcoal);
    color: var(--dst-cream);
    text-decoration: none;
}

/* Light variant for use on dark backgrounds */
.dst-section-charcoal .dst-btn-secondary,
.dst-cta-banner .dst-btn-secondary {
    color: var(--dst-cream);
    border-color: var(--dst-cream);
}

.dst-section-charcoal .dst-btn-secondary:hover,
.dst-cta-banner .dst-btn-secondary:hover {
    background-color: var(--dst-cream);
    color: var(--dst-charcoal);
}

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

.dst-btn-outline:hover {
    background-color: var(--dst-terracotta);
    color: var(--dst-white);
    text-decoration: none;
}

/* --- Content Sections --- */
.dst-section {
    padding: var(--dst-section-padding) 40px;
}

.dst-section-cream {
    background-color: var(--dst-cream);
}

.dst-section-charcoal {
    background-color: var(--dst-charcoal);
    color: var(--dst-cream);
}

.dst-section-charcoal h2,
.dst-section-charcoal h3 {
    color: var(--dst-cream);
}

.dst-section-inner {
    max-width: var(--dst-content-width);
    margin: 0 auto;
}

.dst-section-narrow {
    max-width: var(--dst-narrow-width);
    margin: 0 auto;
}

/* --- Section Headers --- */
.dst-section-header {
    text-align: center;
    margin-bottom: 50px;
}

.dst-section-header h2 {
    position: relative;
    display: inline-block;
}

.dst-section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--dst-terracotta);
    margin: 15px auto 0;
}

.dst-section-header p {
    font-size: 1.25rem;
    color: var(--dst-sienna);
    max-width: 600px;
    margin: 15px auto 0;
}

/* --- Cards --- */
.dst-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.dst-card {
    background: var(--dst-white);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(61, 74, 79, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dst-card:hover {
    box-shadow: 0 4px 16px rgba(61, 74, 79, 0.15);
    transform: translateY(-2px);
}

.dst-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.dst-card-body {
    padding: 25px;
}

.dst-card-body h3 {
    font-size: 1.4rem;
    margin-bottom: 0.4em;
}

.dst-card-body p {
    font-size: 1.05rem;
    color: var(--dst-charcoal-light);
    margin-bottom: 1em;
}

.dst-card-meta {
    font-family: var(--dst-ui-font);
    font-size: 0.9rem;
    color: var(--dst-tan-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* --- Timeline Component --- */
.dst-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.dst-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--dst-terracotta);
    margin-left: -1.5px;
}

.dst-timeline-entry {
    position: relative;
    margin-bottom: 40px;
    width: 50%;
    box-sizing: border-box;
}

.dst-timeline-entry:nth-child(odd) {
    text-align: right;
    padding-right: 35px;
    margin-left: 0;
}

.dst-timeline-entry:nth-child(even) {
    margin-left: 50%;
    padding-left: 35px;
}

.dst-timeline-entry::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--dst-terracotta);
    border: 3px solid var(--dst-cream);
    border-radius: 50%;
    top: 5px;
    z-index: 1;
}

.dst-timeline-entry:nth-child(odd)::before {
    right: -10px;
}

.dst-timeline-entry:nth-child(even)::before {
    left: -10px;
}

.dst-timeline-date {
    font-family: var(--dst-heading-font);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dst-terracotta);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.dst-timeline-title {
    font-family: var(--dst-heading-font);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dst-charcoal);
    margin-bottom: 8px;
}

.dst-timeline-body {
    font-size: 1.05rem;
    color: var(--dst-charcoal-light);
}

/* Clickable timeline entries */
a.dst-timeline-link {
    display: block;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: 4px;
    padding-top: 5px;
    padding-bottom: 5px;
}

a.dst-timeline-link:hover {
    text-decoration: none !important;
    transform: translateX(3px);
}

a.dst-timeline-link:nth-child(odd):hover {
    transform: translateX(-3px);
}

a.dst-timeline-link:hover .dst-timeline-title {
    color: var(--dst-terracotta);
}

a.dst-timeline-link:hover .dst-timeline-date {
    color: var(--dst-terracotta-dark);
}

/* --- Visit Info Cards --- */
.dst-visit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.dst-visit-card {
    background: var(--dst-cream);
    padding: 30px;
    border-left: 4px solid var(--dst-terracotta);
    border-radius: 0 3px 3px 0;
}

.dst-visit-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5em;
    color: var(--dst-terracotta);
}

.dst-visit-card p {
    font-size: 1.05rem;
    margin-bottom: 0;
}

/* --- Quote/Pullquote --- */
.dst-pullquote {
    border-left: 4px solid var(--dst-terracotta);
    padding: 20px 30px;
    margin: 40px 0;
    background: var(--dst-cream);
}

.dst-pullquote p {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--dst-charcoal);
    margin-bottom: 0.5em;
}

.dst-pullquote cite {
    font-family: var(--dst-ui-font);
    font-size: 0.85rem;
    font-style: normal;
    color: var(--dst-sienna);
}

/* --- Gallery --- */
.dst-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.dst-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 3px;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.dst-gallery img:hover {
    opacity: 0.85;
}

/* --- Social Media Feed --- */
.dst-social-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.dst-social-post {
    background: var(--dst-white);
    border: 1px solid var(--dst-cream-dark);
    border-radius: 3px;
    padding: 20px;
}

.dst-social-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-family: var(--dst-ui-font);
    font-size: 0.85rem;
    color: var(--dst-sienna);
}

/* --- Rotating Quotes --- */
.dst-quote-rotator {
    position: relative;
    min-height: 180px;
    border-left: 4px solid var(--dst-terracotta);
    padding: 0;
    background: var(--dst-cream);
    overflow: hidden;
    transition: height 1s ease;
}

.dst-quote-slide {
    padding: 30px 40px 30px 36px;
    box-sizing: border-box;
}

.dst-quote-slide p {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--dst-charcoal);
    margin-bottom: 0.5em;
    line-height: 1.65;
}

.dst-quote-slide cite {
    font-family: var(--dst-ui-font);
    font-size: 0.8rem;
    font-style: normal;
    color: var(--dst-sienna);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dst-quote-theme-tag {
    display: inline-block;
    font-family: var(--dst-ui-font);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--dst-terracotta);
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .dst-quote-rotator {
        min-height: 220px;
    }

    .dst-quote-slide p {
        font-size: 1.25rem;
    }
}

/* --- Get Involved / CTA Banner --- */
.dst-cta-banner {
    background-color: var(--dst-terracotta);
    color: var(--dst-white);
    padding: 60px 40px;
    text-align: center;
}

.dst-cta-banner h2 {
    color: var(--dst-white);
    font-size: 2.2rem;
    margin-bottom: 0.3em;
}

.dst-cta-banner p {
    font-size: 1.25rem;
    color: var(--dst-cream);
    max-width: 600px;
    margin: 0 auto 1.5em;
}

.dst-cta-banner .dst-btn-secondary {
    border-color: var(--dst-white);
    color: var(--dst-white);
}

.dst-cta-banner .dst-btn-secondary:hover {
    background-color: var(--dst-white);
    color: var(--dst-terracotta);
}

/* --- Contact Form --- */
.dst-contact-form input,
.dst-contact-form textarea {
    font-family: var(--dst-body-font);
    font-size: 1rem;
    border: 1px solid var(--dst-cream-dark);
    padding: 12px 16px;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 2px;
    transition: border-color 0.2s ease;
}

.dst-contact-form input:focus,
.dst-contact-form textarea:focus {
    outline: none;
    border-color: var(--dst-terracotta);
}

.dst-contact-form label {
    font-family: var(--dst-ui-font);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dst-charcoal);
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Footer (override GP defaults) --- */
.footer-widgets,
.site-info {
    background-color: var(--dst-charcoal) !important;
    color: var(--dst-cream) !important;
}

.site-info a {
    color: var(--dst-tan-gold);
}

.site-footer {
    background-color: var(--dst-charcoal);
    color: var(--dst-cream);
    padding: 60px 40px 30px;
}

.dst-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    max-width: var(--dst-content-width);
    margin: 0 auto;
}

.dst-footer-col:nth-child(1) {
    text-align: left;
}

.dst-footer-col:nth-child(2) {
    text-align: center;
}

.dst-footer-col:nth-child(3) {
    text-align: right;
}

.dst-footer-col h4 {
    font-family: var(--dst-heading-font);
    color: var(--dst-tan-gold);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1em;
}

.dst-footer-col p,
.dst-footer-col a {
    font-size: 1rem;
    color: var(--dst-cream);
    line-height: 1.8;
}

.dst-footer-col a:hover {
    color: var(--dst-terracotta-light);
}

.dst-footer-bottom {
    max-width: var(--dst-content-width);
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(240, 235, 224, 0.15);
    text-align: center;
    font-family: var(--dst-ui-font);
    font-size: 0.8rem;
    color: var(--dst-tan-gold);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --dst-section-padding: 50px;
    }

    /* Mobile header */
    .dst-header-inner {
        flex-wrap: wrap;
        padding: 8px 20px;
    }

    .dst-header-logo img {
        height: 50px;
    }

    /* Show mobile toggle */
    .dst-menu-toggle {
        display: block;
    }

    /* Hide menu by default on mobile */
    .dst-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .dst-nav.toggled ul {
        display: flex;
    }

    .dst-nav {
        width: 100%;
        order: 3;
    }

    .dst-nav ul li {
        width: 100%;
    }

    .dst-nav ul li a {
        padding: 12px 15px;
        border-bottom: 1px solid rgba(240,235,224,0.15);
    }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.9rem; }
    h3 { font-size: 1.5rem; }

    .dst-hero {
        padding: 60px 25px;
    }

    .dst-hero h1 {
        font-size: 2.4rem;
    }

    .dst-hero-logo {
        max-width: 200px;
    }

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

    .dst-timeline::before {
        left: 20px;
    }

    .dst-timeline-entry,
    .dst-timeline-entry:nth-child(odd),
    .dst-timeline-entry:nth-child(even) {
        width: calc(100% - 50px);
        margin-left: 50px;
        text-align: left;
        padding-left: 0;
    }

    .dst-timeline-entry::before,
    .dst-timeline-entry:nth-child(odd)::before,
    .dst-timeline-entry:nth-child(even)::before {
        left: -38px;
    }

    .dst-footer-grid {
        grid-template-columns: 1fr;
    }

    .dst-footer-col:nth-child(2),
    .dst-footer-col:nth-child(3) {
        text-align: left;
    }

    .dst-visit-grid {
        grid-template-columns: 1fr;
    }

    /* Themes page two-column layout */
    .dst-section-inner > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Support page donate grid */
    .dst-section-inner > div[style*="grid-template-columns: 1fr 1fr"][style*="max-width: 900px"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 18px;
    }

    .dst-hero h1 {
        font-size: 2rem;
    }

    .dst-section {
        padding: 40px 20px;
    }
}
