/*
Theme Name: Silverhilll
Theme URI: https://silverhill.co.uk/
Author: Silverhill School
Author URI: https://silverhill.co.uk/
Description: A modern, professional WordPress theme for Silverhill School inspired by the official website design. Features green/yellow/blue color scheme, dropdown navigation, news updates, event calendar, and responsive mobile-friendly layout.
Version: 2.2.1
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: silverhilll
*/

/*--------------------------------------------------------------
# CSS Reset & Base
--------------------------------------------------------------*/
:root {
    --color-green: #008543;
    --color-yellow: #F6B40E;
    --color-blue: #0072BB;
    --color-dark-green: #006837;
    --color-light-green: #E8F5E9;
    --color-text: #333333;
    --color-text-light: #666666;
    --font-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-heading: "Poppins", "Segoe UI Semibold", sans-serif;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-base);
    color: var(--color-text);
    background-color: #fff;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--color-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--color-green);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

.site-main {
    min-height: 60vh;
}

/* Page content styling */
.entry-content {
    line-height: 1.8;
    color: var(--color-text);
}

.entry-content h1 {
    color: var(--color-green);
    font-family: var(--font-heading);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Make entry h2 match the existing h3 styling (calendar-group h3)
   and ensure h2 colour matches h1 */
.entry-content h2 {
    color: var(--color-green); /* matches h1 */
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Make entry h3 match the existing h4 styling (calendar-event-item h4) */
.entry-content h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin: 0.375rem 0;
}

.entry-content a {
    color: var(--color-blue);
    font-weight: 500;
}

.entry-content a:hover {
    color: var(--color-green);
}

.entry-content ul,
.entry-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.entry-content li {
    margin: 0.5rem 0;
}

/*--------------------------------------------------------------
# File Downloads (WP File block)
--------------------------------------------------------------*/
.entry-content figure.wp-block-file {
    width: 100%;
    margin: 1.5rem 0;
    padding: 0;
}

.entry-content .wp-block-file {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--color-green);
    background: var(--color-light-green);
    box-shadow: var(--shadow-soft);
    width: 100%;
    flex-wrap: wrap;
}

.entry-content .wp-block-file > a:first-of-type {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--color-green);
    text-decoration: none;
}

/* File-type icons: show a small inline icon/badge before the file link
   We detect the type from the file URL (href) using attribute selector.
   Currently adds a PDF badge for links ending with ".pdf". This avoids
   JS and works purely in CSS. */
/* Target the file link but exclude the download button link which also
   is an anchor (has class .wp-block-file__button). Using :not() keeps
   the pseudo-element from appearing on the button. */
.entry-content .wp-block-file > a:not(.wp-block-file__button):first-of-type {
    position: relative; /* for the pseudo-element */
    padding-left: 3.1rem; /* room for icon + gap */
}

.entry-content .wp-block-file > a:not(.wp-block-file__button):first-of-type::before {
    content: "";
    position: absolute;
    left: 0.625rem; /* 10px */
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem; /* 28px */
    height: 1.75rem; /* 28px */
    display: block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border-radius: 4px;
    /* Default (fallback) icon for unknown file types */
    background-image: url("images/file-type-generic.svg");
}


/* Image/photo file types (case-insensitive) — show photo icon */
/* Image/photo file types (case-insensitive) — show photo icon. Exclude the
   download button via :not(.wp-block-file__button) to avoid accidental
   application to the button anchor. */
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".jpg" i]::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".jpeg" i]::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".png" i]::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".gif" i]::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".webp" i]::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".svg" i]::before {
    background-image: url("images/file-type-photo.svg");
}

/* PDF icon */
/* PDF icon (exclude download button) */
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".pdf" i]::before {
    background-image: url("images/file-type-pdf.svg");
}

/* Slightly darker badge on hover/focus to give affordance */
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".pdf" i]:hover::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".pdf" i]:focus::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".jpg" i]:hover::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".jpg" i]:focus::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".jpeg" i]:hover::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".jpeg" i]:focus::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".png" i]:hover::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".png" i]:focus::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".gif" i]:hover::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".gif" i]:focus::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".webp" i]:hover::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".webp" i]:focus::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".svg" i]:hover::before,
.entry-content .wp-block-file > a:not(.wp-block-file__button)[href$=".svg" i]:focus::before {
    filter: brightness(0.95);
}

.entry-content .wp-block-file > a:first-of-type:hover {
    color: var(--color-blue);
}

.entry-content .wp-block-file .wp-block-file__extension {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    background: var(--color-light-green);
    color: var(--color-green);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
}

.entry-content .wp-block-file .wp-block-file__button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background: var(--color-blue);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    text-decoration: none;
}

.entry-content .wp-block-file .wp-block-file__button:hover,
.entry-content .wp-block-file .wp-block-file__button:focus {
    background: var(--color-green);
    color: #fff;
    box-shadow: var(--shadow-hover);
}

.entry-content .wp-block-file .wp-block-file__button::before {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 3a1 1 0 0 1 1 1v8.586l2.293-2.293a1 1 0 1 1 1.414 1.414l-4.007 4.007a1.5 1.5 0 0 1-2.121 0L6.572 11.707a1 1 0 1 1 1.414-1.414L10.3 12.607V4a1 1 0 0 1 1-1Zm-7 14a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 3a1 1 0 0 1 1 1v8.586l2.293-2.293a1 1 0 1 1 1.414 1.414l-4.007 4.007a1.5 1.5 0 0 1-2.121 0L6.572 11.707a1 1 0 1 1 1.414-1.414L10.3 12.607V4a1 1 0 0 1 1-1Zm-7 14a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.entry-content .wp-block-file .wp-block-file__button + .wp-block-file__extension {
    margin-left: 0.5rem;
}

.entry-content .wp-block-file.download-has-description {
    flex-direction: column;
    align-items: flex-start;
}

.entry-content .wp-block-file .wp-element-caption {
    margin: 0.75rem 0 0;
    color: var(--color-text-light);
}

@media (max-width: 640px) {
    .entry-content .wp-block-file {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem 0.5rem;
        flex-wrap: nowrap;
    }

    .entry-content .wp-block-file > a:not(.wp-block-file__button):first-of-type {
        flex: 0 0 auto;
        justify-content: flex-start;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .entry-content .wp-block-file > a:not(.wp-block-file__button):first-of-type::before {
        position: static;
        transform: none;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    .entry-content .wp-block-file .wp-block-file__button {
        justify-content: center;
        flex: 0 0 auto;
        margin: 0 0.5rem;
        width: calc(100% - 1rem);
    }
}

.entry-header {
    margin-bottom: 2rem;
}

.entry-header .section-title {
    margin-bottom: 0.5rem;
}

.entry-thumbnail {
    margin-bottom: 2rem;
}

.featured-image-wrapper {
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.featured-image-wrapper img,
.featured-image-wrapper .page-featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-featured-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.page-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    font-weight: 600;
}

.page-links a {
    display: inline-block;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-light-green);
    color: var(--color-green);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.page-links a:hover {
    background: var(--color-green);
    color: #fff;
}

/* Archive pages */
.page-header {
    margin-bottom: 3rem;
    text-align: center;
}

.archive-description {
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 700px;
    margin: 1rem auto 0;
}

/* Pagination */
.pagination,
.posts-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination .page-numbers,
.posts-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0.5rem 1rem;
    background: #fff;
    color: var(--color-text);
    border: 2px solid var(--color-light-green);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.posts-pagination .page-numbers:hover {
    background: var(--color-green);
    color: #fff;
    border-color: var(--color-green);
}

.pagination .page-numbers.current,
.posts-pagination .page-numbers.current {
    background: var(--color-green);
    color: #fff;
    border-color: var(--color-green);
}

.pagination .page-numbers.dots,
.posts-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-green);
    color: #fff;
    box-shadow: var(--shadow-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-blue);
    color: var(--color-blue);
}

.btn-outline:hover {
    color: #fff;
    background: var(--color-blue);
    border-color: var(--color-blue);
}

header.site-header {
    background: var(--color-green);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-header .btn[data-menu-toggle] {
    display: none;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-branding .custom-logo-link {
    display: flex;
    align-items: center;
}

.site-branding img {
    height: 70px;
    width: auto;
}

/* Prevent the logo image from being squashed when nav/title overflow. */
.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* keep branding block fixed so the logo never changes size */
    flex: 0 0 auto; /* do not grow or shrink */
}

.site-branding .custom-logo-link,
.site-branding img {
    flex: 0 0 auto; /* never let the image shrink or grow */
    height: 70px; /* always 70px high as requested */
    max-height: 70px;
    width: auto;
    object-fit: contain; /* preserve aspect ratio */
    display: block;
}

/* Make the navigation the flexible element so it yields space before the logo */
.site-navigation {
    display: flex;
    align-items: center;
    justify-content: end;
    flex: 1 1 0%; /* allow nav to grow/shrink and be squashed */
    min-width: 0; /* necessary for overflow/wrapping to work inside flex */
}

.site-identity {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Site title: allow natural wrapping across lines when needed */
.site-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: normal; /* allow wrapping */
    overflow: visible;
}

/* Subtitle styling (separate from the core tagline/description) */
.site-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    line-height: 1.2;
}

.site-title a {
    color: #fff;
}

.site-title a:hover {
    color: var(--color-yellow);
}

.site-description {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.site-navigation {
    display: flex;
    align-items: center;
}

[data-primary-nav].is-open {
    display: flex;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current_page_item > a {
    background: var(--color-dark-green);
    color: var(--color-yellow);
}

/* Dropdown styles */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 240px;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    border-radius: 4px;
    z-index: 1000;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu li {
    position: relative;
}

.primary-menu .sub-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.primary-menu .sub-menu li a:hover {
    background: var(--color-light-green);
    color: var(--color-green);
    padding-left: 1.75rem;
}

/* Nested dropdowns (3rd level and beyond) */
.primary-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 0;
}

.primary-menu .sub-menu li:hover > .sub-menu,
.primary-menu .sub-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Dropdown indicator */
.primary-menu li.menu-item-has-children > a::after {
    content: "▼";
    margin-left: 0.5rem;
    font-size: 0.65rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

/* Nested dropdown indicator points right on desktop */
.primary-menu .sub-menu li.menu-item-has-children > a::after {
    content: "▶";
    margin-left: auto;
    padding-left: 0.5rem;
}

/* Mobile parent link in submenu */
.mobile-parent-link {
    display: none;
}

.menu-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

body.menu-open {
    overflow: hidden;
}

/* Hero Carousel */
.hero .hero-carousel {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    aspect-ratio: 21 / 9;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.carousel-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
    line-height: 1;
}

.carousel-button:hover,
.carousel-button:focus {
    background: rgba(0, 0, 0, 0.8);
    outline: 3px solid var(--color-yellow);
    outline-offset: -3px;
}

.carousel-button-prev {
    left: 1rem;
}

.carousel-button-next {
    right: 1rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.carousel-indicator:hover,
.carousel-indicator:focus {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
    outline: 2px solid var(--color-yellow);
    outline-offset: 2px;
}

.carousel-indicator.active {
    background: #fff;
    transform: scale(1.3);
}

@media (max-width: 768px) {
    .hero .hero-carousel {
        border-radius: 8px;
        width: 100%;
    }

    .carousel-button {
        padding: 0.75rem 1rem;
        font-size: 1.25rem;
    }

    .carousel-button-prev {
        left: 0.5rem;
    }

    .carousel-button-next {
        right: 0.5rem;
    }

    .carousel-indicators {
        bottom: 1rem;
        gap: 0.5rem;
    }

    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
}

.hero {
    position: relative;
    padding: 1.5rem;
    background: var(--color-yellow);
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-family: var(--font-heading);
    color: var(--color-text);
    margin: 0 0 1rem;
    font-weight: 600;
}

.hero-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0;
    color: var(--color-text);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.hero-carousel {
    position: relative;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.hero-carousel img {
    width: 100%;
    height: auto;
    display: block;
}

.section {
    padding: 2.75rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.5vw, 2rem);
    color: var(--color-green);
    margin: 0;
    font-weight: 700;
}

.grid {
    display: grid;
    gap: 2rem;
}

.news-card,
.event-card,
.page-card {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.news-card:hover,
.event-card:hover,
.page-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.event-card {
    cursor: pointer;
}

.event-card * {
    pointer-events: none;
}

/* News card image wrapper with fixed 21:9 aspect ratio */
.news-image-wrapper {
    display: block;
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    position: relative;
}

.news-image-wrapper .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Other card images (events, etc.) */
.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.event-image-wrapper {
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    position: relative;
    border-radius: 6px;
    margin: 0.5rem 0;
}

.event-image-wrapper .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.event-card:hover .event-image-wrapper .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-meta {
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-text-light);
    font-weight: 600;
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    color: var(--color-green);
    font-weight: 700;
    line-height: 1.4;
}

.card-title a {
    color: var(--color-green);
}

.card-title a:hover {
    color: var(--color-blue);
}

.card-excerpt {
    margin: 0;
    color: var(--color-text-light);
    line-height: 1.6;
    flex: 1;
}

.event-date {
    font-weight: 600;
    color: var(--color-green);
    font-size: 0.95rem;
    background: var(--color-light-green);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
}

.event-date .dashicons {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 1.1rem;
}

/* Event year group display */
.event-year-group {
    font-weight: 600;
    color: var(--color-blue);
    font-size: 0.9rem;
    background: #e8f4f8;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
}

.event-year-group .dashicons {
    width: 1rem;
    height: 1rem;
    font-size: 1rem;
}

/* INSET day styling */
.event-inset {
    cursor: default !important;
    background: #fffbeb;
    border: 2px solid #fbbf24;
}

.event-inset:hover {
    transform: none !important;
    box-shadow: var(--shadow-soft) !important;
}

.inset-day-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0;
}

.inset-day-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f59e0b;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inset-day-header .dashicons {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 1.2rem;
}

.inset-day-date {
    font-size: 1.1rem;
    font-weight: 700;
    color: #d97706;
}

.inset-day-note {
    font-size: 0.9rem;
    color: #92400e;
    font-style: italic;
}

/* INSET days in term dates view */
.term-inset-days {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
}

.term-inset-title {
    font-size: 1rem;
    font-weight: 700;
    color: #d97706;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.term-inset-title .dashicons {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 1.2rem;
}

.inset-days-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.inset-day-item {
    display: flex;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #fbbf24;
}

.inset-day-date {
    font-weight: 700;
    color: #d97706;
    font-size: 0.95rem;
}

.quick-link-card,
.info-card {
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.quick-link-card:hover,
.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.quick-link-image-wrapper {
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    position: relative;
}

.quick-link-image-wrapper .quick-link-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.quick-link-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1.5rem 1rem 1rem;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
}

.quick-link-no-image {
    background: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1.5rem;
    text-align: center;
}

.calendar-group {
    margin-bottom: 2.5rem;
}

.calendar-group h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--color-green);
}

.calendar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.calendar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.calendar-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

.calendar-content {
    flex: 1;
}

.quick-links-section .vision-quote {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    padding: 1.5rem 1rem 1.75rem;
    text-align: center;
    position: relative;
}

.quick-links-section .vision-quote::before,
.quick-links-section .vision-quote::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 88px;
    height: 2px;
    background: var(--color-yellow);
    transform: translateX(-50%);
    opacity: 0.9;
}

.quick-links-section .vision-quote::before {
    top: 0;
}

.quick-links-section .vision-quote::after {
    bottom: 0.5rem;
}

.vision-quote-title {
    margin: 0 0 1.5rem;
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 0.9rem + 1.6vw, 2rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #2a2a2a;
}

.vision-quote-text {
    position: relative;
    margin: 0 auto;
    padding: 0 2.5rem;
    max-width: 36rem;
    font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem);
    line-height: 1.5;
    font-style: italic;
    color: var(--color-text);
}

.vision-quote-text::before,
.vision-quote-text::after {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.vision-quote-text::before {
    content: "“";
    top: -0.75rem;
    left: 0.5rem;
}

.vision-quote-text::after {
    content: "”";
    bottom: -1.75rem;
    right: 0.5rem;
}

.vision-quote-text p {
    margin: 0;
}

@media (max-width: 600px) {
    .quick-links-section .vision-quote {
        padding: 1.25rem 0.5rem 2rem;
    }

    .vision-quote-title {
        letter-spacing: 0.08em;
    }

    .vision-quote-text {
        padding: 0 1.25rem;
    }

    .vision-quote-text::before {
        left: -0.25rem;
        top: -1rem;
    }

    .vision-quote-text::after {
        right: -0.25rem;
        bottom: -1.5rem;
    }
}
/* Events View Toggle */
.events-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border: 2px solid var(--color-green);
    border-radius: 8px;
    color: var(--color-green);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle-btn:hover {
    background: var(--color-light-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.view-toggle-btn.active {
    background: var(--color-green);
    color: #fff;
}

.view-toggle-btn .dashicons {
    font-size: 1.2rem;
    width: 1.2rem;
    height: 1.2rem;
}

/* Events List View with Term Grouping */
.events-list-view {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.events-term-group {
    margin-bottom: 2rem;
}

.term-header {
    background: linear-gradient(to right, var(--color-light-green) 0%, #fff 100%);
    border-left: 5px solid var(--color-green);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.term-heading {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-green);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.term-heading .dashicons {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1.8rem;
}

.term-dates-range {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.events-holiday-group .term-header {
    background: linear-gradient(to right, #fef3e8 0%, #fff 100%);
    border-left-color: #f4a261;
}

.events-holiday-group .term-heading {
    color: #e76f51;
}

/* Term Dates Simple List View */
.events-terms-view {
    margin-top: 1.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.terms-list-intro {
    background: #f9f9f9;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-green);
    margin-bottom: 2rem;
}

.terms-list-intro p {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
}

.terms-simple-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.term-list-item {
    background: #fff;
    border: 2px solid #e8f5f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.term-list-item:hover {
    border-color: var(--color-green);
    box-shadow: var(--shadow-soft);
}

.term-list-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.term-list-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-green);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 250px;
}

/* Add to Calendar Button */
.add-to-calendar-wrapper {
    position: relative;
    display: inline-block;
}

.add-to-calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-calendar-btn:hover {
    transform: translateY(-2px);
}

.add-to-calendar-btn .dashicons {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 1.1rem;
}

.calendar-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 200px;
    overflow: hidden;
}

.calendar-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95rem;
    color: var(--color-text);
}

.calendar-option:hover {
    background: #f5f5f5;
}

.calendar-option:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.calendar-option .dashicons {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 1.2rem;
    color: var(--color-green);
    flex-shrink: 0;
}

.calendar-option .dashicons-google {
    color: #4285F4;
}

.calendar-option .dashicons-calendar {
    color: #0078D4;
}

.calendar-option .dashicons-smartphone {
    color: #555;
}

.calendar-option .dashicons-download {
    color: var(--color-green);
}

.term-list-title .dashicons {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1.5rem;
}

.term-list-dates {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.term-list-date-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f9f9f9;
    border-radius: 6px;
}

.term-list-date-row .date-label {
    font-weight: 700;
    color: var(--color-green);
    min-width: 50px;
    font-size: 0.95rem;
}

.term-list-date-row .date-value {
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    flex: 1;
    user-select: all;
}

.term-list-description {
    padding-top: 1rem;
    border-top: 1px solid #e8f5f0;
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.term-list-description p:last-child {
    margin-bottom: 0;
}

/* Calendar View Container */
.events-calendar-view {
    margin-top: 1.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
}

.calendar-month-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin: 0;
    color: var(--color-green);
}

.calendar-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-green);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-nav-btn:hover {
    background: var(--color-dark-green);
    transform: scale(1.1);
}

.calendar-nav-btn .dashicons {
    font-size: 1.2rem;
    width: 1.2rem;
    height: 1.2rem;
}

/* Calendar Grid */
.calendar-grid-container {
    background: #fff;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.calendar-weekday {
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-green);
    padding: 0.375rem;
    font-size: 0.7rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border-radius: 6px;
    border: 1.5px solid transparent;
    background: #f9f9f9;
    position: relative;
    transition: all 0.3s ease;
}

.calendar-day.empty {
    background: transparent;
    border: none;
}

.calendar-day.today {
    border-color: var(--color-blue);
    background: var(--color-light-blue);
}

.calendar-day.has-events {
    background: var(--color-light-green);
    border-color: var(--color-green);
}

.calendar-day.has-events:hover {
    background: var(--color-green);
    transform: scale(1.05);
    box-shadow: var(--shadow-soft);
}

.calendar-day.has-events:hover .event-badge {
    background: #fff;
    color: var(--color-green);
}

.calendar-day.active {
    background: var(--color-green);
    border-color: var(--color-dark-green);
    box-shadow: var(--shadow-hover);
}

.calendar-day.active .event-badge {
    background: #fff;
    color: var(--color-green);
}

.day-number {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.event-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--color-green);
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
}

/* Calendar Events List */
.calendar-events-list {
    margin-top: 1.5rem;
}

.selected-date-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-green);
    margin-bottom: 1rem;
    padding-bottom: 0.375rem;
    border-bottom: 2px solid var(--color-yellow);
}

.calendar-day-events {
    display: grid;
    gap: 1rem;
}

.calendar-event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.calendar-event-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.calendar-event-item .event-thumbnail {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 6px;
    overflow: hidden;
}

.calendar-event-item .event-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.calendar-event-item .event-details {
    flex: 1;
}

.calendar-event-item .event-time {
    display: inline-block;
    background: var(--color-yellow);
    color: var(--color-text);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.calendar-event-item h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin: 0.375rem 0;
}

.calendar-event-item h4 a {
    color: var(--color-green);
    text-decoration: none;
}

.calendar-event-item h4 a:hover {
    color: var(--color-dark-green);
    text-decoration: underline;
}

.calendar-event-item p {
    margin: 0.375rem 0;
    color: var(--color-text);
    line-height: 1.5;
    font-size: 0.9rem;
}

.calendar-event-item .event-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-text-light);
    font-size: 0.8rem;
}

.calendar-event-item .event-location .dashicons {
    width: 0.9rem;
    height: 0.9rem;
    font-size: 0.9rem;
}

/* Calendar view INSET day styling */
.calendar-event-inset {
    background: #fffbeb !important;
    border: 2px solid #fbbf24;
}

.calendar-event-inset:hover {
    transform: none !important;
    box-shadow: var(--shadow-soft) !important;
}

.calendar-inset-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 0.25rem 0;
}

.calendar-inset-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f59e0b;
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-inset-header .dashicons {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 1.1rem;
}

.calendar-inset-time {
    font-size: 0.95rem;
    font-weight: 700;
    color: #d97706;
}

.calendar-inset-note {
    font-size: 0.85rem;
    color: #92400e;
    font-style: italic;
}

/* Calendar view year group badge */
.event-year-group-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #e8f4f8;
    color: var(--color-blue);
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.event-year-group-badge .dashicons {
    width: 0.9rem;
    height: 0.9rem;
    font-size: 0.9rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Term Date Indicators on Calendar */
.calendar-day.term-time {
    background: #e8f5f0;
    border-color: var(--color-green);
}

.calendar-day.term-time.has-events {
    background: var(--color-light-green);
    border-color: var(--color-dark-green);
}

/* Term Start Date - Prominent Left Border */
.calendar-day.term-start {
    border-left: 4px solid var(--color-green);
    background: linear-gradient(to right, var(--color-green) 0%, var(--color-green) 4px, #e8f5f0 4px);
    font-weight: 700;
    position: relative;
}

.calendar-day.term-start .day-number {
    color: var(--color-dark-green);
}

/* Term End Date - Prominent Right Border */
.calendar-day.term-end {
    border-right: 4px solid var(--color-green);
    background: linear-gradient(to left, var(--color-green) 0%, var(--color-green) 4px, #e8f5f0 4px);
    font-weight: 700;
    position: relative;
}

.calendar-day.term-end .day-number {
    color: var(--color-dark-green);
}

/* When a day is both start and end (single-day term) */
.calendar-day.term-start.term-end {
    border: 3px solid var(--color-green);
    background: var(--color-light-green);
}

.calendar-day.term-start.term-end::before,
.calendar-day.term-start.term-end::after {
    background: var(--color-dark-green);
}

/* Term Dates Archive Page */
.term-year-group {
    margin-bottom: 3rem;
}

.term-year-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-green);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--color-yellow);
}

.term-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.term-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.term-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.term-time {
    border-left-color: var(--color-green);
    background: linear-gradient(to right, #e8f5f0 0%, #fff 10%);
}

.term-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 24px;
}

.term-time .term-icon {
    background: var(--color-light-green);
    color: var(--color-green);
}

.term-icon .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

.term-content {
    flex: 1;
}

.term-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    color: var(--color-text);
}

.term-dates-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.term-date-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.term-date-label {
    font-weight: 600;
    color: var(--color-text-light);
    min-width: 50px;
}

.term-date-value {
    color: var(--color-text);
    font-weight: 500;
}

.term-description {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.term-description p:last-child {
    margin-bottom: 0;
}

.term-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.term-time .term-type-badge {
    background: var(--color-green);
    color: #fff;
}

.no-terms-message {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.no-terms-message p {
    font-size: 1.1rem;
    color: var(--color-text-light);
}

.footer {
    background: var(--color-green);
    color: #fff;
    padding: 3rem 0 1.5rem;
}

.footer a {
    color: #fff;
}

.footer a:hover {
    color: var(--color-yellow);
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.footer .widget-title {
    color: var(--color-yellow);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-bottom {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.footer-menu {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li {
    margin: 0;
}

.footer-menu a {
    font-size: 0.9rem;
}

@media (max-width: 992px) {
    .site-header .btn[data-menu-toggle] {
        display: inline-flex;
        background: var(--color-yellow);
        color: var(--color-green);
        padding: 0.75rem 1.5rem;
        border-radius: 6px;
    }

    .site-header .btn[data-menu-toggle]:hover {
        background: #fff;
    }

    .site-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-dark-green);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        max-height: calc(100vh - 100%);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-navigation.is-open {
        display: block;
    }

    .primary-menu {
        flex-direction: column;
        width: 100%;
        padding-bottom: 2rem;
    }

    .primary-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .primary-menu > li > a {
        padding: 1rem 1.5rem;
        width: 100%;
    }

    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    /* Show submenu when parent has submenu-open class */
    .primary-menu li.submenu-open > .sub-menu {
        max-height: 2000px;
    }

    /* Rotate arrow indicator when submenu is open */
    .primary-menu li.menu-item-has-children.submenu-open > a::after {
        transform: rotate(180deg);
    }

    .primary-menu .sub-menu li a {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.75rem 2rem;
    }

    .primary-menu .sub-menu li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--color-yellow);
    }

    /* Nested submenus on mobile */
    .primary-menu .sub-menu .sub-menu {
        background: rgba(0, 0, 0, 0.3);
        margin-left: 0;
    }

    .primary-menu .sub-menu .sub-menu li a {
        padding: 0.75rem 3rem;
    }

    /* Show mobile parent link */
    .mobile-parent-link {
        display: block;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-parent-link a {
        font-weight: 700 !important;
        color: var(--color-yellow) !important;
    }

    /* Nested dropdown indicator on mobile */
    .primary-menu .sub-menu li.menu-item-has-children > a::after {
        content: "▼";
    }

    .hero {
        padding: 1rem;
    }

    .section {
        padding: 1.5rem 0;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .calendar-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .grid {
        grid-template-columns: 1fr !important;
    }

    /* Calendar View Mobile Styles */
    .calendar-month-title {
        font-size: 1.1rem;
    }

    .calendar-weekday {
        font-size: 0.6rem;
        padding: 0.2rem;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .event-badge {
        width: 14px;
        height: 14px;
        font-size: 0.55rem;
    }

    .calendar-event-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .calendar-event-item .event-thumbnail {
        width: 100%;
        height: 150px;
    }

    /* Term Dates Mobile */
    .term-dates-grid {
        grid-template-columns: 1fr;
    }

    .term-year-title {
        font-size: 1.4rem;
    }

    .term-card {
        flex-direction: column;
    }

    .term-icon {
        width: 40px;
        height: 40px;
    }

    .term-icon .dashicons {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }

    /* Events List Term Headers Mobile */
    .term-header {
        padding: 1rem 1.25rem;
    }

    .term-heading {
        font-size: 1.4rem;
    }

    .term-heading .dashicons {
        width: 1.4rem;
        height: 1.4rem;
        font-size: 1.4rem;
    }

    .term-dates-range {
        font-size: 0.9rem;
    }

    /* Term Dates List View Mobile */
    .term-list-item {
        padding: 1.25rem;
    }

    .term-list-title {
        font-size: 1.3rem;
    }

    .term-list-date-row {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.75rem;
    }

    .term-list-date-row .date-label {
        font-size: 0.85rem;
    }

    .term-list-date-row .date-value {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .site-branding img {
        height: 50px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .quick-links-section .grid,
    .info-grid-section .grid {
        grid-template-columns: 1fr !important;
    }

    /* Calendar View Small Mobile */
    .events-view-toggle {
        flex-direction: column;
    }

    .view-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .calendar-controls {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .calendar-month-title {
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }

    .calendar-grid-container {
        padding: 0.6rem;
    }

    .calendar-weekday {
        font-size: 0.55rem;
    }

    .day-number {
        font-size: 0.7rem;
    }

    /* Events List Term Headers Small Mobile */
    .term-header {
        padding: 0.75rem 1rem;
    }

    .term-heading {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .term-heading .dashicons {
        width: 1.2rem;
        height: 1.2rem;
        font-size: 1.2rem;
    }

    .term-dates-range {
        font-size: 0.85rem;
    }

    /* Term Dates List View Small Mobile */
    .terms-list-intro {
        padding: 1rem;
    }

    .term-list-item {
        padding: 1rem;
    }

    .term-list-title {
        font-size: 1.15rem;
        flex-wrap: wrap;
    }

    .term-list-title .dashicons {
        width: 1.15rem;
        height: 1.15rem;
        font-size: 1.15rem;
    }

    .term-list-date-row {
        padding: 0.5rem 0.75rem;
    }

    .term-list-date-row .date-value {
        font-size: 0.9rem;
    }
}

/* Accessibility improvements */
/*
 * Mobile: hide duplicated parent links inside sub-menus.
 *
 * Many mobile nav patterns duplicate the parent menu item as the
 * first entry inside its own `.sub-menu`. Hiding the first child
 * keeps the mobile dropdown focused on the actual children links.
 * This is intentionally scoped to mobile breakpoints.
 */
@media (max-width: 992px) {
    /* If the parent menu item has children, hide the first sub-menu item
       which is commonly the duplicated parent link. */
    .primary-menu .menu-item-has-children > .sub-menu > li:first-child {
        display: none !important;
    }

    /* Also hide any specifically-marked mobile parent links if present */
    .primary-menu .sub-menu .mobile-parent-link {
        display: none !important;
    }
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-green);
    color: #fff;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--color-yellow);
    outline-offset: 2px;
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--color-light-green);
    clip: auto !important;
    clip-path: none;
    color: var(--color-text);
    display: block;
    font-size: 0.875rem;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/*--------------------------------------------------------------
# Staff Directory (Nested List)
--------------------------------------------------------------*/
.staff-directory {
    max-width: 900px;
    margin: 0 auto;
}

.staff-hierarchy,
.staff-children,
.team-members {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Team grouping */
.team-group {
    list-style: none;
    margin: 0.5rem 0;
}

.team-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0.4rem 0;
}

.team-count {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.85rem;
    margin-left: 0.35rem;
}

.staff-item {
    margin: 0.75rem 0;
    position: relative;
}

.staff-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    border: 1px solid rgba(16, 24, 40, 0.04);
    transition: all 0.2s ease;
}

.staff-member:hover {
    background: #fbfdff;
    transform: translateY(-1px);
}

.staff-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.staff-avatar-fallback {
    color: #fff;
}

.staff-initials {
    font-weight: 600;
    font-size: 1rem;
}

.staff-details {
    flex: 1 1 auto;
    min-width: 0;
}

.staff-name {
    margin: 0 0 0.125rem;
    font-size: 1rem;
    color: var(--color-green);
    line-height: 1.3;
}

.staff-name a {
    color: inherit;
    text-decoration: none;
}

.staff-name a:hover {
    color: var(--color-blue);
}

.staff-position {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.staff-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #374151;
}

.staff-email,
.staff-phone {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.staff-email a {
    color: var(--color-blue);
    text-decoration: none;
}

.staff-email a:hover {
    text-decoration: underline;
}

.staff-email .dashicons,
.staff-phone .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Staff responsibilities chips */
.staff-responsibilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.4rem;
}

.responsibility-chip {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background-color: var(--color-light-green);
    color: var(--color-green);
    border-radius: 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--color-green);
    transition: all 0.2s ease;
}

.responsibility-chip:hover {
    background-color: var(--color-green);
    color: #fff;
}

/* Toggle button */
.toggle-children {
    border: 1px solid rgba(15, 23, 42, 0.06);
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    color: #0f172a;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: all 0.18s ease;
}

.toggle-icon {
    transition: transform 0.18s ease;
    font-size: 1.1rem;
}

.toggle-children[aria-expanded="false"] .toggle-icon {
    transform: rotate(-90deg);
}

.toggle-children:hover {
    background: #eef4ff;
    transform: translateY(-1px);
}

.toggle-children:active {
    transform: translateY(0);
}

.toggle-children:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.10);
    border-color: rgba(15, 23, 42, 0.12);
}

/* Plus/minus SVG styling */
.toggle-icon svg {
    display: block;
}

.toggle-icon svg line {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.toggle-icon svg .vertical {
    opacity: 1;
    transform-origin: center;
}

.toggle-children[aria-expanded="true"] .toggle-icon svg .vertical {
    opacity: 0;
    transform: scaleY(0.2);
}

.toggle-children[aria-expanded="false"] .toggle-icon svg .vertical {
    opacity: 1;
    transform: scaleY(1);
}

.toggle-icon svg .horizontal {
    transform-origin: center;
}

.staff-item.has-children .staff-member {
    cursor: pointer;
}

/* Nested children styling */
.staff-children {
    margin-left: 2.4rem;
    margin-top: 0.6rem;
    border-left: 2px solid #94aca1;
    padding-left: 1.2rem;
}

.staff-children.collapsed {
    display: none;
}

/* Different level styling */
.staff-level-0 .staff-member {
    background: linear-gradient(180deg, #f8fafc, #fff);
}

.staff-level-1 .staff-member {
    background: #fff;
}

.staff-level-2 .staff-member {
    background: #ffffff;
    opacity: 0.98;
}

/* Responsive adjustments */
@media (max-width: 700px) {
    .staff-member {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.6rem;
        padding: 0.5rem;
    }

    .staff-avatar {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    .staff-details {
        flex: 1 1 auto;
    }

    .staff-responsibilities {
        flex: 1 1 100%;
        margin-left: 0;
        padding-left: 0;
    }

    .toggle-children {
        flex: 0 0 auto;
    }

    .staff-children {
        margin-left: 2.4rem;
    }

    .toggle-children {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
}

/* Accessibility helpers */
.screen-reader-text {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.staff-reports-to {
    padding: 1rem;
    background: var(--color-light-green);
    border-radius: 8px;
    border-left: 4px solid var(--color-green);
}

.staff-reports-to strong {
    color: var(--color-green);
}

.staff-reports-to a {
    color: var(--color-blue);
    font-weight: 600;
    text-decoration: none;
}

.staff-reports-to a:hover {
    color: var(--color-green);
    text-decoration: underline;
}

.manager-job-title {
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-style: italic;
}

.staff-direct-reports {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.staff-direct-reports h2 {
    color: var(--color-green);
    margin-bottom: 1.5rem;
}

.staff-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.staff-report-card {
    background: #fff;
    border: 2px solid var(--color-light-green);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

.staff-report-card:hover {
    border-color: var(--color-green);
    box-shadow: var(--shadow-soft);
    transform: translateY(-4px);
}

.staff-report-photo {
    margin-bottom: 1rem;
}

.staff-report-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-light-green);
}

.staff-report-name {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.staff-report-name a {
    color: var(--color-green);
    text-decoration: none;
}

.staff-report-name a:hover {
    color: var(--color-blue);
}

.staff-report-job {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0;
}

.back-to-staff {
    margin-top: 2rem;
    text-align: center;
}

.back-to-staff .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-green);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.back-to-staff .btn:hover {
    background: var(--color-dark-green);
}

 /* Fix: center images placed with Core Image block when WP sets .wp-block-image to display:table
    Explanation: WordPress core/block-library may set .wp-block-image to display:table which
    prevents text-align:center on the parent from centering the image in some cases.
    Override to ensure images center reliably while keeping captions accessible.
*/
/* Prefer centering the img itself (safe, specific) */
.wp-block-image img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    /* preserve existing responsive behaviour */
    max-width: 100%;
}

/* Also ensure figure wrapper behaves sanely for centered alignment and captions */
.wp-block-image {
    display: block;
    text-align: center; /* keeps captions centered */
}

/* If the image has aligncenter class, make sure the wrapper centers */
.wp-block-image.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

/* Preserve inline caption alignment */
.wp-block-image figcaption {
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .org-card {
        min-width: 240px;
        padding: 1rem;
    }

    .org-avatar {
        width: 80px;
        height: 80px;
    }

    .org-name {
        font-size: 1.1rem;
    }

    .org-children {
        flex-direction: column;
        align-items: center;
    }

    .staff-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .staff-profile-photo .staff-photo {
        width: 150px;
        height: 150px;
    }

    .staff-reports-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    /* Add to Calendar responsive styles */
    .term-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .term-list-title {
        min-width: 100%;
    }

    .add-to-calendar-wrapper {
        width: 100%;
    }

    .add-to-calendar-btn {
        width: 100%;
        justify-content: center;
    }

    .calendar-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-navigation,
    .footer,
    .btn,
    [data-menu-toggle] {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .org-card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}
