/**
 * CHP Manchester - Main Stylesheet
 * Colors: #e30713 (CHP Red), #063d5d (CHP Blue)
 */

:root {
    --chp-red: #e30713;
    --chp-blue: #063d5d;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.header-top {
    padding: 20px 0;
    border-bottom: 2px solid var(--chp-red);
    transition: padding 0.3s ease;
    background-color: var(--white);
}

.main-header.scrolled .header-top {
    padding: 10px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo .chp-logo {
    height: 60px;
    width: auto;
}

.site-title h1 {
    font-family: 'Futura', sans-serif;
    font-size: 28px;
    color: var(--chp-red);
    margin: 0;
    font-weight: bold;
}

.site-title p {
    font-size: 14px;
    color: var(--text-light);
    margin: 5px 0 0 0;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-images {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.header-img {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-img:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.image-label {
    display: none;
}

/* Navigation */
.main-nav {
    background-color: var(--chp-blue);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-logo-section {
    display: none;
    align-items: center;
    gap: 10px;
}

.nav-logo-link {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 40px;
    width: auto;
    display: none;
}

.nav-title {
    display: none;
    color: var(--white);
    font-weight: bold;
    font-family: 'Futura', sans-serif;
    font-size: 18px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: rgba(255,255,255,0.1);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 300px);
    padding: 40px 0;
}

/* Mobile Header Content (shown only on mobile, inside main-content) */
.mobile-header-content {
    display: none; /* Hidden on desktop */
    background-color: var(--white);
    padding: 20px 0;
    border-bottom: 2px solid var(--chp-red);
    margin-bottom: 30px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--chp-red) 0%, var(--chp-blue) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    margin-top: 0; /* Remove any margin since main-content has margin-top */
}

.hero-section h2 {
    font-size: 48px;
    font-family: 'Futura', sans-serif;
    margin-bottom: 20px;
    font-weight: bold;
}

.hero-section p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--chp-red);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #c10611;
}

.btn-secondary {
    background-color: var(--chp-blue);
}

.btn-secondary:hover {
    background-color: #052a42;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.card-title {
    font-size: 32px;
    color: var(--chp-red);
    margin-bottom: 30px;
    font-family: 'Futura', sans-serif;
    font-weight: bold;
    border-bottom: 3px solid var(--chp-red);
    padding-bottom: 15px;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-item {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 16:9 so admin-cropped cover images show fully */
.news-card-media-btn {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.news-card-media-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item-content {
    padding: 20px;
}

.news-item h3 {
    font-size: 20px;
    color: var(--chp-red);
    margin-bottom: 10px;
}

.news-item p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.news-item-date {
    font-size: 14px;
    color: var(--text-light);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--chp-red);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.main-footer {
    background-color: var(--chp-blue);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
    color: var(--white);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input {
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.7);
}

.newsletter-form button {
    padding: 10px;
    background-color: var(--chp-red);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

/* Management Team */
.management-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.management-group {
    margin-bottom: 50px;
}

.management-group h2 {
    color: var(--chp-blue);
    font-family: 'Futura', sans-serif;
    font-size: 20px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--chp-blue);
    font-weight: 500;
}

.management-member {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.management-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.management-photo {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
    width: 120px;
    height: 180px;
    overflow: hidden;
}

.management-member img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    display: block;
}

.management-photo:hover img {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.management-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.management-member h3 {
    color: var(--chp-red);
    margin-bottom: 8px;
    font-size: 18px;
    font-family: 'Gotham', sans-serif;
}

.management-member h3 a {
    color: var(--chp-blue);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.management-member h3 a:hover {
    color: var(--chp-red);
    text-decoration: underline;
    transform: translateY(-2px);
}

.management-member p {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

/* Management Detail Page */
.management-detail-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.management-detail-photo-wrapper {
    flex: 0 0 auto;
}

.management-detail-photo {
    width: 120px;
    height: 180px;
    overflow: hidden;
}

.management-detail-photo img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.management-detail-info {
    flex: 1;
    min-width: 300px;
}

.management-detail-name {
    color: var(--chp-red);
    margin-bottom: 10px;
    font-family: 'Gotham', sans-serif;
}

.management-detail-title {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.management-detail-group {
    color: var(--chp-blue);
    font-weight: 500;
    margin-bottom: 30px;
}

.management-detail-resume {
    line-height: 1.8;
    margin-top: 30px;
}

.management-detail-back {
    margin-bottom: 20px;
}

.management-detail-back .btn {
    display: inline-block;
}

/* Contact Page */
.contact-info {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.contact-info h3 {
    color: var(--chp-blue);
    margin-bottom: 10px;
    font-size: 18px;
}

.contact-info a {
    color: var(--chp-red);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* News detail gallery */
.news-gallery {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.news-gallery-inner {
    flex: 1;
    min-width: 0;
}

.news-gallery-main {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    aspect-ratio: 16 / 9;
}

.news-gallery-slide {
    display: none;
    position: absolute;
    inset: 0;
}

.news-gallery-slide.is-active {
    display: block;
}

.news-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.news-video-wrapper iframe,
.news-video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Page gallery: video as thumbnail only (poster + play), no video element */
.news-video-poster-wrapper {
    background: var(--chp-blue);
}

.news-video-poster-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--chp-blue);
}

.news-video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.95);
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.news-video-play-overlay svg {
    width: 80px;
    height: 80px;
}

.news-video-fallback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
}

.news-video-fallback p {
    margin: 0;
    color: var(--text-dark);
}

.news-video-fallback a {
    color: var(--chp-red);
    font-weight: 500;
}

/* Page gallery arrows – left/right of image, bigger */
.news-gallery-nav {
    flex: 0 0 auto;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: background 0.2s;
}

.news-gallery-nav:hover {
    background: rgba(0,0,0,0.75);
}

.news-gallery-thumbs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-top: 10px;
    padding: 3px 2px 4px 2px;
    -webkit-overflow-scrolling: touch;
}

.news-gallery-thumb {
    border: 2px solid var(--border-color);
    padding: 0;
    background: none;
    cursor: pointer;
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0.7;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.news-gallery-thumb.is-active {
    opacity: 1;
    border-color: var(--chp-red);
}

.news-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-gallery-thumb-video {
    position: relative;
    background: var(--chp-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.news-thumb-video-poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--chp-blue);
}

.news-gallery-thumb-video .news-thumb-play-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.news-gallery-thumb-video .news-thumb-play-icon svg {
    width: 28px;
    height: 28px;
}

/* Full-page lightbox for news gallery */
.news-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px 80px 20px 80px;
}

.news-lightbox.is-open {
    display: flex;
}

.news-lightbox-content {
    position: relative;
    max-width: 1000px;
    width: 100%;
    max-height: 100%;
}

.news-lightbox-main {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.news-lightbox-slide {
    display: none;
}

.news-lightbox-slide.is-active {
    display: block;
}

.news-lightbox-slide img {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

/* Arrows outside image, left/right of page */
.news-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    z-index: 2001;
    transition: background 0.2s;
}

.news-lightbox-nav:hover {
    background: rgba(0,0,0,0.85);
}

.news-lightbox-nav.prev {
    left: 20px;
}

.news-lightbox-nav.next {
    right: 20px;
}

/* Close button top-right, outside image */
.news-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.news-lightbox-close:hover {
    background: rgba(0,0,0,0.95);
}

.news-lightbox-thumbs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-top: 10px;
    padding: 3px 2px 4px 2px;
    -webkit-overflow-scrolling: touch;
}

.news-lightbox-thumb {
    border: 2px solid var(--border-color);
    padding: 0;
    background: none;
    cursor: pointer;
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0.7;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.news-lightbox-thumb.is-active {
    opacity: 1;
    border-color: var(--chp-red);
}

.news-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-lightbox-thumb-video {
    position: relative;
    background: var(--chp-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.news-lightbox-thumb-video .news-thumb-video-poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--chp-blue);
}

.news-lightbox-thumb-video .news-thumb-play-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.news-lightbox-thumb-video .news-thumb-play-icon svg {
    width: 28px;
    height: 28px;
}

body.news-lightbox-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .news-gallery {
        gap: 8px;
    }

    .news-gallery-nav {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .news-gallery-thumb {
        width: 60px;
        height: 60px;
    }

    .news-lightbox {
        padding: 60px 16px 20px 16px;
    }

    .news-lightbox-nav {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .news-lightbox-nav.prev {
        left: 10px;
    }

    .news-lightbox-nav.next {
        right: 10px;
    }

    .news-lightbox-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .news-lightbox-thumb {
        width: 60px;
        height: 60px;
    }
}

