/*
Theme Name: Flying Ram Productions
Theme URI: https://flyingramproductions.com
Author: Built for Robert Ballantyne
Author URI: https://flyingramproductions.com
Description: Bespoke theme for Flying Ram Productions (Robert Ballantyne). Includes four custom templates - Home, Project, My Story and Notebook - with friendly meta boxes for adding images, links and extra content outside the main editor. Fully mobile responsive.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flying-ram
*/

/* =========================================================
   1. DESIGN TOKENS
   ========================================================= */
:root {
    --color-bg:      #191814; /* dark brown page background */
    --color-box:     #231f1c; /* darker brown box background */
    --color-red:     #df1e07; /* red accent */
    --color-text:    #ffffff; /* body text */
    --color-cream:   #efeae3; /* other light text */
    --color-muted:   #b9b1a8; /* softened cream for secondary copy */
    --color-line:    #3a332e; /* hairline / dividers */
    --color-black:   #000000; /* header bar */

    --font-head: "Dosis", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;

    --wrap: 1240px;
    --gap: 40px;
    --radius: 2px;
}

/* =========================================================
   2. RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--color-red); text-decoration: none; transition: color .18s ease, opacity .18s ease; }
a:hover { color: var(--color-cream); }

p { margin: 0 0 1.25em; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 500; /* Dosis Medium */
    color: var(--color-cream);
    line-height: 1.02;
    margin: 0 0 .4em;
    letter-spacing: .5px;
}
h2 { margin-top: 25px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.subhead {
    font-family: var(--font-head);
    font-weight: 600; /* Dosis SemiBold */
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-red);
}

/* Buttons -------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 14px;
    padding: 15px 26px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
}
.btn--primary { background: var(--color-red); color: #fff; }
.btn--primary:hover { background: #ff2f16; color: #fff; }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.35); color: var(--color-cream); }
.btn--ghost:hover { border-color: var(--color-red); color: #fff; }

.link-arrow {
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 14px;
    color: var(--color-red);
}
.link-arrow:hover { color: var(--color-cream); }

/* =========================================================
   3. SITE HEADER + NAV
   ========================================================= */
.site-header {
    background: var(--color-black);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #000;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 12px 24px;
    gap: 24px;
}
/* Header logo: ~70% size, vertically centred */
.site-logo { display: flex; align-items: center; }
.site-logo svg,
.site-logo img { height: 28px; width: auto; display: block; margin-top:15px; margin-bottom:15px; }

/* Menu */
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 34px; margin: 0; padding: 0; }
.main-nav li { position: relative; }
.main-nav a {
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 15px;
    color: #ffffff;
}
.main-nav a:hover { color: var(--color-red); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current-menu-ancestor > a,
.main-nav .current-menu-parent > a { color: var(--color-red); }

/* Dropdown (matches red box in mockups) */
.main-nav ul ul {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    left: -14px;
    min-width: 190px;
    background: var(--color-red);
    padding: 8px 0;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
    z-index: 120;
}
.main-nav li:hover > ul,
.main-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.main-nav ul ul li { width: 100%; }
.main-nav ul ul a { display: block; color: #fff; padding: 9px 20px; font-size: 14px; letter-spacing: 1px; }
.main-nav ul ul a:hover { color: #000; background: rgba(0,0,0,.12); }
.main-nav ul ul .current-menu-item > a { color: #000; }

/* Mobile toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    width: 44px; height: 44px;
    padding: 0;
    cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 26px; height: 2px; background: #fff; position: relative; margin: 0 auto;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before { position: absolute; top: -8px; }
.nav-toggle span::after  { position: absolute; top: 8px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle span::after  { transform: translateY(-8px) rotate(-45deg); }

/* =========================================================
   4. HOME TEMPLATE
   ========================================================= */
.home-hero {
    position: relative;
    background-size: cover;
    background-position: center right;
    min-height: 640px;
    display: flex;
    align-items: center;
}
.home-hero::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(10,9,8,.92) 0%, rgba(10,9,8,.55) 45%, rgba(10,9,8,.25) 100%),
                linear-gradient(0deg, var(--color-bg) 2%, rgba(25,24,20,0) 30%);
}
.home-hero__inner { position: relative; z-index: 2; max-width: var(--wrap); margin: 0 auto; padding: 90px 24px; width: 100%; }
.home-hero__name {
    font-size: clamp(64px, 12vw, 168px);
    line-height: .86;
    color: var(--color-cream);
    margin: 0;
    display: inline-block;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 60%;
    border-bottom: 3px solid var(--color-red);
    padding-bottom: 12px;
}
.home-hero__roles {
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-text);
    font-size: clamp(15px, 1.6vw, 22px);
    margin: 20px 0 34px;
}
.home-hero__roles .dot { color: var(--color-text); margin: 0 6px; }
.home-hero__intro { max-width: 620px; color: var(--color-cream); font-size: 18px; }

.section { padding: 90px 0; }
.section--tight { padding: 70px 0; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 44px;
    flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(38px, 5vw, 60px); margin: 25px 0 0; }

/* Featured projects: header controls + horizontal carousel */
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }

.fp-controls { display: inline-flex; align-items: center; gap: 20px; }
.carousel-nav { display: inline-flex; gap: 8px; }
.carousel-btn {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1.5px solid var(--color-red);
    background: transparent; color: var(--color-red);
    font-family: var(--font-head); font-size: 24px; line-height: 1;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background .18s ease, color .18s ease, opacity .18s ease;
}
.carousel-btn:hover { background: var(--color-red); color: #fff; }
.carousel-btn.is-hidden { opacity: 0; visibility: hidden; }

.carousel { position: relative; }
.carousel__track {
    display: flex;
    gap: 34px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > .project-card { flex: 0 0 calc((100% - 68px) / 3); scroll-snap-align: start; }
.project-card { background: var(--color-box); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.project-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-card:hover .project-card__media img { transform: scale(1.05); }
.project-card__body { padding: 26px 28px 34px; }
.project-card__body h3 { font-size: 30px; margin: 0 0 12px; }
.project-card__body p { color: var(--color-muted); font-size: 15.5px; margin: 0; line-height: 1.6; }
.project-card a.project-card__link { color: inherit; display: flex; flex-direction: column; height: 100%; }

/* Story-first split section */
.story-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; }
.story-split__media img { width: 100%; border-radius: var(--radius); filter: grayscale(1) contrast(1.05); }
.story-split__title { font-size: clamp(44px, 6vw, 74px); line-height: .95; margin: 25px 0 26px; }
.story-split__title .accent { color: var(--color-red); display: block; }
.story-split__body { color: var(--color-cream); font-size: 17.5px; }
.story-split__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 34px; }

/* =========================================================
   5. PROJECT TEMPLATE
   ========================================================= */
.project-single {
    position: relative;
    background-color: var(--color-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}
.project-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        ".     head"
        "media body";
    column-gap: 0;
    row-gap: 0;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 70px 24px 100px;
    align-items: start;
}
.project-layout__head { grid-area: head; background: var(--color-box); border-left: 2px solid var(--color-red); padding: 46px 46px 0 46px; }
.project-layout__head h1 { font-size: clamp(40px, 4.6vw, 56px); margin: 0 0 6px; }
.project-genre { font-size: 20px; margin: 0; }
.project-layout__media { grid-area: media; align-self: start; }
.project-layout__media img { display: block; width: 100%; border-radius: 0; }
.project-layout__body { grid-area: body; background: var(--color-box); border-left: 2px solid var(--color-red); padding: 30px 46px 50px 46px; color: var(--color-cream); }
.project-layout__body p { margin-bottom: 1.4em; }

/* =========================================================
   6. MY STORY TEMPLATE
   ========================================================= */
.story-hero {
    position: relative;
    min-height: 560px;
    background-size: cover;
    background-position: center; /* mobile default - looks good */
    display: flex;
    align-items: flex-end;
}
.story-hero::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(0deg, var(--color-bg) 3%, rgba(25,24,20,.15) 55%, rgba(25,24,20,.45) 100%);
}
/* Toned-down / desaturated look to match the mockup */
.story-hero::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: #808080;
    mix-blend-mode: saturation;
    opacity: .55;
    pointer-events: none;
}
.story-hero__inner { position: relative; z-index: 2; max-width: var(--wrap); margin: 0 auto; width: 100%; padding: 0 24px 56px; }
.story-hero__title {
    font-size: clamp(70px, 11vw, 150px);
    margin: 0;
    line-height: .92;
    color: var(--color-cream);
    display: inline-block;
    border-bottom: 3px solid var(--color-red);
    padding-bottom: 16px;
}
.story-hero__tagline { font-style: italic; color: var(--color-muted); font-size: clamp(16px, 1.7vw, 21px); max-width: 500px; margin: 26px 0 0; line-height: 1.3; }

.story-intro { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; padding: 80px 0 40px; }
.story-intro__lead { font-family: var(--font-head); font-weight: 500; font-size: clamp(20px, 2vw, 27px); line-height: 1.14; letter-spacing: .3px; color: var(--color-cream); margin: 0 0 24px; }
.story-intro__body { color: var(--color-muted); font-size: 16.5px; }
.story-quote { border-left: 2px solid var(--color-red); padding-left: 30px; }
.story-quote blockquote { margin: 0; font-style: italic; font-size: clamp(22px, 2.5vw, 32px); line-height: 1.3; color: var(--color-cream); }
.story-quote cite { display: block; margin-top: 22px; font-style: normal; font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--color-red); font-size: 14px; }

.timeline-head { padding-top: 40px; }
.timeline-head .subhead { font-size: 14px; }
.timeline-head h2 { font-size: clamp(40px, 6vw, 68px); margin: 6px 0 50px; }

.timeline { position: relative; padding-bottom: 80px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 40px; width: 2px; background: var(--color-line); }
.timeline__item { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 50px; padding: 0 0 60px 44px; align-items: start; }
.timeline__item::before { content: ""; position: absolute; left: 0; top: 8px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--color-red); background: var(--color-bg); }
.timeline__period { font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 3px; color: var(--color-red); font-size: 13px; margin-bottom: 6px; }
.timeline__title { font-size: clamp(30px, 3.4vw, 44px); margin: 0 0 16px; line-height: .95; }
.timeline__text { color: var(--color-muted); font-size: 16px; }
.timeline__media img { width: 100%; border-radius: var(--radius); filter: grayscale(.55) contrast(1.03) brightness(.9); }

/* =========================================================
   7. NOTEBOOK / SINGLE POST TEMPLATE
   ========================================================= */
.notebook { position: relative; overflow: hidden; background: var(--color-bg); }
.notebook__bg {
    position: absolute; inset: 0;
    background-repeat: no-repeat;
    background-position: center bottom;   /* aligned to the bottom of the page */
    background-size: 100% auto;           /* scales with page width, covers full width */
    pointer-events: none; z-index: 0;
}
.notebook__inner {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: 1.55fr .75fr; gap: 56px;
    max-width: var(--wrap); margin: 0 auto; padding: 60px 24px 100px;
    align-items: start;
}
/* Red vertical divider runs down the right of the image AND the text box only */
.notebook__main { border-right: 2px solid var(--color-red); }
.note-featured { display: block; width: 100%; border: 0; border-radius: 0; }
.note-article { background: var(--color-box); border-radius: 0; padding: 40px 46px 60px; }
.note-article h1 { font-size: clamp(48px, 6vw, 78px); margin: 0 0 26px; line-height: .9; }
.note-article .note-body { color: var(--color-cream); }
.note-article .note-body p { margin-bottom: 1.4em; }

.recent-notes { padding-top: 6px; }
.recent-notes h2 { font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 3px; font-size: 26px; color: var(--color-cream); margin: 0 0 26px; }
.recent-notes ul { list-style: none; margin: 0; padding: 0; }
.recent-notes li { position: relative; padding: 0 0 22px 30px; }
.recent-notes li::before { content: ""; position: absolute; left: 0; top: 8px; width: 13px; height: 13px; border-radius: 50%; background: var(--color-red); }
.recent-notes a { color: var(--color-cream); font-size: 19px; line-height: 1.3; }
.recent-notes a:hover { color: var(--color-red); }

/* =========================================================
   8. GENERIC PAGE / FALLBACK
   ========================================================= */
.page-basic { max-width: 820px; margin: 0 auto; padding: 70px 24px 100px; }
.page-basic h1 { font-size: clamp(40px, 5vw, 62px); margin-bottom: 30px; }
.page-basic .entry-content { color: var(--color-cream); }

/* =========================================================
   9. SITE FOOTER
   ========================================================= */
.site-footer { background: var(--color-black); padding: 40px 0 46px; }
.site-footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; display: flex; justify-content: flex-end; }
.site-footer__credit { font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; color: var(--color-red); }
.site-footer__credit a { color: var(--color-red); }
.site-footer__credit a:hover { color: var(--color-cream); }

/* =========================================================
   10. RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    .featured-grid { grid-template-columns: 1fr 1fr; }
    .carousel__track > .project-card { flex: 0 0 calc((100% - 34px) / 2); }
    .home-hero__name { max-width: 100%; }
    .story-split { grid-template-columns: 1fr; gap: 40px; }
    .story-intro { grid-template-columns: 1fr; gap: 40px; }
    .timeline__item { grid-template-columns: 1fr; gap: 24px; }
    .timeline__media { max-width: 420px; }
    .notebook__inner { grid-template-columns: 1fr; gap: 40px; }
    .note-article { padding: 34px 28px 50px; }
}

@media (max-width: 860px) {
    /* Mobile navigation */
    .nav-toggle { display: block; }
    .main-nav {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(320px, 84vw);
        background: var(--color-black);
        transform: translateX(100%);
        transition: transform .28s ease;
        padding: 84px 30px 40px;
        overflow-y: auto;
        z-index: 130;
    }
    .nav-open .main-nav { transform: translateX(0); }
    .main-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
    .main-nav > ul > li { width: 100%; border-bottom: 1px solid #1c1c1c; }
    .main-nav a { display: block; padding: 14px 0; font-size: 17px; }
    .main-nav ul ul {
        position: static; opacity: 1; visibility: visible; transform: none;
        background: transparent; box-shadow: none; padding: 0 0 8px 16px;
    }
    .main-nav ul ul a { color: var(--color-cream); padding: 8px 0; }
    .main-nav ul ul a:hover { color: var(--color-red); background: transparent; }
    .nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 125; }
    .nav-open .nav-backdrop { opacity: 1; visibility: visible; }
}

/* Desktop only: nudge the My Story hero down so the head is never cropped */
@media (min-width: 861px) {
    .story-hero { background-position: center 18%; }
}

@media (max-width: 768px) {
    /* Projects stack: image first, then the brown text box (title + body) */
    .project-layout {
        grid-template-columns: 1fr;
        grid-template-areas: "media" "head" "body";
        row-gap: 0;
        padding-bottom: 70px;
    }
    .project-layout__media { margin-bottom: 22px; }
    .project-layout__head { padding: 32px 24px 0 24px; }
    .project-layout__body { padding: 26px 24px 34px 24px; }
}

@media (max-width: 680px) {
    body { font-size: 16px; }
    .section { padding: 60px 0; }
    .featured-grid { grid-template-columns: 1fr; }
    .carousel__track > .project-card { flex: 0 0 100%; }
    .home-hero { min-height: 480px; }
    .home-hero__name { max-width: 100%; }
    .home-hero__intro { font-size: 16.5px; }
    .story-split__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* Contact form */
.contact-wrap { max-width: 720px; margin: 0 auto; padding: 70px 24px 100px; }
.contact-wrap h1 { font-size: clamp(40px, 5vw, 62px); margin-bottom: 20px; }
.contact-wrap .entry-content { color: var(--color-cream); margin-bottom: 34px; }
.contact-form .form-field { margin-bottom: 22px; }
.contact-form label { display: block; font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; font-size: 14px; color: var(--color-cream); margin-bottom: 8px; }
.contact-form input, .contact-form textarea { width: 100%; background: var(--color-box); border: 1px solid var(--color-line); color: #fff; font-family: var(--font-body); font-size: 16px; padding: 14px 16px; border-radius: 2px; }
.contact-form textarea { resize: vertical; min-height: 160px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--color-red); }
.contact-form .btn { margin-top: 6px; border: 0; cursor: pointer; }
.fr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-notice { padding: 16px 18px; border-radius: 2px; margin-bottom: 26px; }
.form-notice--ok { background: rgba(60,140,60,.15); border: 1px solid #3c8c3c; color: #d8f0d8; }
.form-notice--error { background: rgba(223,30,7,.12); border: 1px solid var(--color-red); color: #ffd9d2; }
.contact-form input, .contact-form textarea { width: 100%; background: #141210; border: 1px solid rgba(255,255,255,.16); color: #fff; font-family: var(--font-body); font-size: 16px; padding: 14px 16px; border-radius: 2px; }




/* Mobile menu fix: lift the sliding menu above the dim overlay + larger tap targets */
@media (max-width: 860px) {
	.nav-open .site-header { z-index: 140; }
	.main-nav a { font-size: 20px; padding: 16px 0; }
	.main-nav ul ul a { font-size: 18px; padding: 12px 0; }
}
