/*
Theme Name: Leedam Farm
Author: Charlie Cooper
Description: Custom WordPress theme for Leedam Farm, Desford.
Version: 1.0.0
Text Domain: leedamfarm
*/

/* --- Reset & Variables --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #FFFDF3;
    font-size: 1rem;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

html{
    font-size: 14px;
    scroll-behavior: smooth;
}

/* --- Typography --- */

h1, h2, h3, .statement-text {
    color: #82704A;
    margin-bottom: 20px;
    font-family: "Playfair Display", serif;
    letter-spacing: -2px;
    line-height: 1.2;
}

h3{
    letter-spacing: -1px;
}

h1{
    font-size: 3.8rem;
    font-weight: 500;
}

h2 {
    font-size: 3rem;
    margin-bottom: 3rem;
    width: min(34rem, 100%);
}

p {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
    margin-bottom: 2rem;
    color: #594140;
}

body:not(.logged-in) {
    --wp-admin--admin-bar--height: 0px;
}

p:not(.central-text p){
    width: min(36rem, 100%);
}

.pretitle {
    text-transform: uppercase;
    color: #A3C2BD;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.brown .pretitle {
    color: #B0CBB0;
}

i {
    font-weight: 400;
}

ul {
    list-style: none;
    margin-bottom: 20px;
}

/* --- Layout --- */

:root {
    --gutter: 25px;
}

section.hero.page-container, .flex {
    display: flex;
    align-items: center;
    gap: 6rem;
}

@media (width < 69rem) {
    :root {
        --gutter: 35px;
    }

    .flex {
        gap: 3rem;
    }
}

@media (width < 37rem) {
    .flex {
        flex-direction: column;
    }
}

.hero-content {
    flex: 6;
    padding: 4rem 0;
}

.hero-content h1 {
    margin-bottom: 3rem;
}

.hero-image {
    flex: 5;
}

.hero-image img {
    border-radius: 280px 0;
}

main#primary {
    display: flex;
    flex-direction: column;
    gap: 7.5rem;
}

section.short-image {
    align-items: normal!important;
}

.page-container{
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.rounded {
    border-radius: 80px;
    padding: 70px;
}

.rounded img{
    border-radius: 18px;
}

.rounded p:last-of-type{
    margin-bottom: 0;
}

.flex-image img{
    object-fit: cover;
    height: 100%;
    width: 100%;
}

.brown{
    background-color: #594140;
}

.brown h2, .brown p, .blue h2, .blue p, .blue h3 {
    color: white;
}

.blue h2{
    margin-bottom: 0.5rem;
}

h3 {
    margin-bottom: 0.25rem;
    font-family: 'Montserrat';
    letter-spacing: 0px;
}

.blue{
    background-color: #91ADA7;
}

.blue img{
    border-radius: 18px;
}

.ctas {
    display: inline-flex;
    gap: 3rem;
    margin-top: 2rem;
}

a.cta-link {
    color: #594140;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
}

a.cta-link svg {
    width: 2.4rem;
    fill: #594140;
}

.brown a.cta-link{
    color: white;
}

.brown a.cta-link svg{
    fill: white;
}

/* --- Header --- */
header#masthead {
    position: sticky;
    top: var(--wp-admin--admin-bar--height);
    width: 100%;
    background-color: #fffdf3;
    z-index: 9999;
}

header .page-container{
    padding: 20px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.social-icons svg {
    width: 2rem;
    fill: #594140;
}

nav#site-navigation {
    position: fixed;
    right: 0;
    height: calc(100% - var(--wp-admin--admin-bar--height));
    bottom: 0;
    width: min(35rem, 100%);
    padding: 5rem;
    display: flex;
    flex-direction: column;
    background-color: #fffdf3;
    border-left: 2px solid #f1f1f1;
    z-index: 5;
    justify-content: space-between;

    /* Start hidden off-screen to the right */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 9998; /* Sits just below the z-index of the button */
    overflow-y: auto;
}

/* State when menu is toggled open */
#site-navigation.is-open {
    transform: translateX(0);
}

img.mobile-menu-logo {
    width: min(6rem, 100%);
}

ul#primary-menu a {
    font-size: 2.5rem;
    color: #82704a;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -2%;
    font-family: 'Playfair Display';
    line-height: 2;
}

img.site-logo, .site-branding {
    width: min(10rem, 100%);
}

.top-bar{
    text-align: center;
    padding: 10px;
    color: white;
    font-weight: 500;
}

.central-text{
    text-align: center;
    width: min(40rem, 100%);
    margin: 0 auto;
}

.central-text h2{
    width: min(36rem, 100%);
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================
   Mobile Menu Button & 'X' Animation
   ========================================================== */
.mobile-menu-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    position: relative;
    align-items: flex-end;
    padding: 8px;
    border: 2px solid #FFFDF3;
    border-radius: 10px;
    transition: border 0.3s ease-in-out;
}

.mobile-menu-button:hover {
    border: 2px solid #f1f1f1;
}

.menu-top {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.mobile-menu-button .bar {
    display: block;
    width: 100%;
    height: 4px;
    background-color: #82704a;
    transition: all 0.3s ease-in-out;
}

div.mobile-menu-button > span:nth-of-type(2) {
    width: 20px;
}

div.mobile-menu-button.is-active > span:nth-of-type(2) {
    width: 100%;
}

/* * Transform into an X. 
 * The math: (bar height + gap) / 2 = (3px + 8px) / 2 = 5.5px
 */
.mobile-menu-button.is-active .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-button.is-active .bar:nth-child(2) {
    transform: translateY(-5.5px) rotate(-45deg);
}

/* Reveal */

.reveal {
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: 1s all ease;
}

.reveal.active {
    transform: translateY(0);
    opacity: 1;
}

/* --- Footer --- */

footer{
    margin-top: 6rem;
}

footer .logo-cow {
    width: 150px;
    transform: translateY(2px);
}

.statement-text {
    font-size: 2rem;
    letter-spacing: -1px;
}

.footer-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
}

.footer-main {
    background-color: #a3c2bc;
    padding: 3rem 0;
}

span.footer-title {
    font-size: 1rem;
    color: #594140;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -1px;
    margin-bottom: 0.8rem;
    display: block;
}

.footer-sections {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.footer-section{
    flex: 1;
}

footer img.redtractor {
    width: 120px;
    margin-top: 1.5rem;
}

footer img.site-logo {
    margin-bottom: 1.5rem;
}

.footer-bottom {
    padding: 0.8rem 0;
}

.footer-text, a.footer-link {
    color: #594140;
    font-weight: 600;
    text-decoration: none;
    display: block;
}

.footer-bottom-text {
    color: #999999;
    font-weight: 500;
    font-size: 0.85rem;
}

.footer-bottom .page-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.footer-bottom .footer-bottom-text a {
    color: #999999;
    display: inline;
    text-decoration: underline;
}

/* responsive iframe */

.video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000; /* Optional: black bars if video doesn't fill */
}

.video-player iframe,
.video-player object,
.video-player embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Mobile Optimisation */

@media(width < 69rem){

    main#primary{
        gap: 3.5rem;
    }

    .rounded {
        border-radius: 40px;
        padding: 60px 45px;
    }

    .footer-sections {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .footer-section{
        flex: unset;
        width: min(250px, 100%);
    }

    .footer-bottom .page-container {
        gap: 1rem;
        flex-direction: column;
        text-align: center;
    }

    footer{
        padding-bottom: env(safe-area-inset-bottom);
    }

    h1{
        font-size: 3.3rem;
    }

    h2 {
        font-size: 2.4rem;
    }

    img.site-logo, .site-branding {
        width: min(7rem, 100%);
    }

    .top-bar {
        font-size: 0.9rem;
    }

}