/* Abbeyfield Wessex - Main Stylesheet */

/* CSS Variables */
:root {
    --primary-color: #78376f;
    --primary-dark: #5b2654;
    --secondary-color: #f28e14;
    --text-color: #0e1013;
    --bg-light: #fff0fd;
    --white: #fff;
    --gray: #878787;
    --font-family: 'Figtree-Regular', Arial, Helvetica, sans-serif;
    --font-bold: 'Figtree-Bold', Arial, Helvetica, sans-serif;
    --font-extrabold: 'Figtree-ExtraBold', Arial, Helvetica, sans-serif;
    --font-medium: 'Figtree-Medium', Arial, Helvetica, sans-serif;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    line-height: 1.5;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    font-family: var(--font-bold);
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
    font-family: var(--font-extrabold);
    font-weight: 510;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.48832rem; }
h2 { font-size: 2.0736rem; }
h3 { font-size: 1.728rem; }
h4 { font-size: 1.44rem; }
h5 { font-size: 1.2rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.header__logo img {
    height: 60px;
    width: auto;
}

.header__nav-list {
    display: flex;
    gap: 25px;
}

.header__nav-list a {
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.header__nav-list a:hover,
.header__nav-list a.active {
    color: var(--primary-color);
    text-decoration: none;
}

.header__nav-button {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.header__nav-button-bar {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .header__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        padding: 1rem;
    }
    
    .header__nav.is-open {
        display: block;
    }
    
    .header__nav-list {
        flex-direction: column;
        gap: 0;
    }
    
    .header__nav-list li {
        border-bottom: 1px solid #eee;
    }
    
    .header__nav-list li:last-child {
        border-bottom: none;
    }
    
    .header__nav-list a {
        display: block;
        padding: 12px 0;
    }
    
    .header__nav-button {
        display: flex;
    }
    
    .header__inner {
        position: relative;
    }
}

/* Banner */
.banner {
    position: relative;
    min-height: 400px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.banner--has-image {
    flex-direction: row-reverse;
}

.banner--has-image.banner--overlay {
    flex-direction: row;
}

.banner--overlay .banner__image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-basis: 100%;
    width: 100%;
    height: 100%;
}

.banner--overlay .banner__image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(91, 38, 84, 0.85) 0%, rgba(120, 55, 111, 0.7) 50%, rgba(120, 55, 111, 0.4) 100%);
}

.banner--overlay .banner__content {
    position: relative;
    z-index: 2;
    background-color: transparent;
    max-width: 100%;
    width: 100%;
    text-align: center;
    justify-content: center;
}

.banner--overlay .banner__content::before {
    display: none;
}

.banner--overlay .banner__title {
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner--overlay .banner__text {
    font-size: 1.15rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.banner__image {
    display: block;
    flex-basis: 60%;
    min-height: 350px;
    background-size: cover;
    background-position: center;
    background-color: var(--secondary-color);
}

.banner__content {
    background-color: var(--primary-dark);
    padding: 50px 25px;
    display: flex;
    align-items: center;
    max-width: 40%;
    position: relative;
    z-index: 1;
}

.banner__content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 110%;
    background-color: var(--primary-dark);
    z-index: -1;
}

.banner__title,
.banner__text,
.banner__text * {
    color: var(--white);
}

.banner__title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.banner--small {
    min-height: 200px;
}

.banner--small .banner__content {
    max-width: 100%;
    width: 100%;
}

.breadcrumb {
    margin-top: 1rem;
    color: var(--white);
}

.breadcrumb a {
    color: var(--white);
}

@media (max-width: 992px) {
    .banner {
        flex-direction: column;
    }
    
    .banner__image {
        height: 250px;
        flex-basis: auto;
    }
    
    .banner__content {
        max-width: 100%;
        padding: 30px 15px;
    }
}

/* Sections */
.section {
    padding: 60px 0;
}

.section--bg-light {
    background-color: var(--bg-light);
}

.section--bg-purple {
    background-color: var(--primary-dark);
}

.section--bg-purple h2,
.section--bg-purple h3,
.section--bg-purple p,
.section--bg-purple a {
    color: var(--white);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 18px 24px;
    border-radius: 8px;
    font-family: var(--font-bold);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn--primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn--primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    text-decoration: none;
}

.btn--secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.btn--secondary:hover {
    background-color: #24896f;
    color: var(--white);
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.card--property {
    border: 1px solid var(--primary-color);
}

.card__image {
    overflow: hidden;
}

.card__image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card__image img {
    transform: scale(1.05);
}

.card__inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card__title {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.card__address,
.card__phone {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.card__tag {
    display: inline-block;
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 10px 0;
}

.card__text-area {
    flex: 1;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.card__date {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.card__tags__item {
    border: 1px solid var(--primary-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Property Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card--team-member {
    background: var(--bg-light);
    text-align: center;
}

.card--team-member .card__image img {
    height: 250px;
}

.card--team-member .card__inner {
    padding: 20px;
}

/* Timeline */
.timeline-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.timeline-block .card__image img {
    height: 300px;
}

.timeline-block .card__title {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

@media (max-width: 480px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
}

/* Careers Section */
.careers-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 30px 0;
}

.careers-content img {
    border-radius: 15px;
    width: 100%;
}

@media (max-width: 768px) {
    .careers-content {
        grid-template-columns: 1fr;
    }
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--white);
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-group--checkbox input[type="checkbox"] {
    margin-top: 5px;
}

.form-group--checkbox label {
    margin-bottom: 0;
}

.form-note,
.form-privacy {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 20px;
}

/* Contact Info */
.contact-info h3 {
    margin-top: 20px;
}

.contact-info address {
    font-style: normal;
    line-height: 1.8;
}

/* Articles Page */
.articles {
    padding-top: 40px;
}

.article-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.article-filters .form-group {
    flex: 0 0 300px;
    margin-bottom: 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.card--article {
    border: 1px solid var(--primary-color);
}

/* Pagination */
.pagination-wrapper {
    margin: 40px 0;
}

.pagination {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pagination li {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pagination li:hover,
.pagination .current-page {
    background: var(--primary-dark);
}

.pagination a {
    color: var(--white);
    text-decoration: none;
}

/* Footer */
.footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer a {
    color: var(--white);
    font-weight: normal;
}

.footer a:hover {
    text-decoration: underline;
}

.footer h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 15px;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer__column ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 30px;
    text-align: center;
}

.footer__social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer__legal {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.footer__bottom p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Blog Carousel */
.blog-carousel {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 1.5rem 0;
    overflow: hidden;
}

.blog-carousel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.blog-carousel__title {
    color: var(--white);
    font-size: 1.2rem;
    margin: 0;
}

.blog-carousel__link {
    color: var(--white);
    font-size: 0.9rem;
    opacity: 0.9;
}

.blog-carousel__link:hover {
    opacity: 1;
}

.blog-carousel__container {
    position: relative;
    height: 200px;
}

.blog-carousel__items {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.blog-carousel__item {
    min-width: 25%;
    padding: 0 0.5rem;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.3s ease;
}

@media (max-width: 992px) {
    .blog-carousel__item {
        min-width: 50%;
    }
}

@media (max-width: 576px) {
    .blog-carousel__item {
        min-width: 100%;
    }
}

.blog-carousel__item-inner {
    position: relative;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.blog-carousel__item-inner:hover {
    text-decoration: none;
}

.blog-carousel__item-inner:hover .blog-carousel__image img {
    transform: scale(1.05);
}

.blog-carousel__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.blog-carousel__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s ease;
}

.blog-carousel__image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

.blog-carousel__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    z-index: 2;
}

.blog-carousel__date {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    font-family: var(--font-medium);
}

.blog-carousel__caption h4 {
    color: var(--white);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-carousel__nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.blog-carousel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.blog-carousel__dot.active,
.blog-carousel__dot:hover {
    background: var(--white);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-white {
    color: var(--white);
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Video badge for blog carousel */
.blog-carousel__video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 3;
    font-weight: 600;
}

/* Footer credit */
.footer__credit {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-top: 10px;
}

.footer__credit a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.footer__credit a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Article hero layout */
.article-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    gap: 40px;
    align-items: center;
}

.article-hero__content {
    max-width: 700px;
}

.article-date {
    display: block;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
}

.article-subheading {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.article-hero__image-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.article-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-hero {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.article-hero h1,
.article-hero p,
.article-hero .article-subheading {
    color: var(--white);
}

.article-hero .article-date {
    color: rgba(255, 255, 255, 0.8);
}

.article-hero .card__tags__item {
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
}

/* Responsive */
@media (max-width: 576px) {
    html {
        font-size: 16px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .properties-grid,
    .team-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-filters .form-group {
        flex: 1 1 100%;
    }
    
    .article-hero__grid {
        grid-template-columns: 1fr;
    }
}
