/* Shared public-page alignment and spacing corrections. Loaded after legacy page CSS. */
:root {
    --site-container: 1200px;
    --site-gutter: clamp(18px, 3vw, 32px);
    --site-section: clamp(56px, 7vw, 88px);
    --site-navy: #0d2b5a;
    --site-blue: #1a4a8c;
    --site-sky: #eaf4ff;
    --site-ink: #17233b;
    --site-text: #526176;
    --site-line: #dce5ef;
    --site-surface: #f6f9fc;
    --site-radius: 16px;
    --site-shadow: 0 10px 30px rgba(13, 43, 90, .08);
}

body { overflow-x: hidden; }
body > section, body > main, body > div { max-width: 100%; }

body .container,
body .mcs-container,
body .container-main {
    width: min(calc(100% - (var(--site-gutter) * 2)), var(--site-container));
    max-width: var(--site-container);
    margin-inline: auto;
}

body .page-header,
body .mcs-page-header,
body .project-page-header,
body .hero-section {
    padding-left: var(--site-gutter);
    padding-right: var(--site-gutter);
}

body .page-header .container,
body .mcs-page-header .mcs-container,
body .project-page-header .container,
body .hero-section .container {
    width: min(100%, var(--site-container));
}

body .section,
body .content-section,
body .mv-section,
body .departments-section,
body .core-values-section,
body .contact-info-section,
body .form-section,
body .article-content,
body .news-content-area,
body .featured-section,
body .search-section,
body .mcs-section,
body .files-section {
    padding-top: var(--site-section) !important;
    padding-bottom: var(--site-section) !important;
}

body .section-header,
body .contact-info-header,
body .services-header,
body .mcs-section-header {
    margin-bottom: clamp(28px, 4vw, 46px) !important;
}

body .section-header p,
body .contact-info-header p,
body .services-header p,
body .mcs-section-header p {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

body .services-grid,
body .areas-grid,
body .projects-grid,
body .contact-grid,
body .news-cards-grid,
body .news-grid,
body .resources-grid,
body .departments-grid,
body .values-grid {
    align-items: stretch;
    gap: clamp(18px, 2.5vw, 30px) !important;
}

body .service-card,
body .area-card,
body .project-card,
body .contact-card,
body .news-card,
body .department-card,
body .value-card {
    height: 100%;
}

body .form-container,
body .contact-card,
body .project-card,
body .news-card,
body .sidebar-widget,
body .mcs-table-wrap,
body .licenses-table {
    border-radius: var(--site-radius) !important;
}

body .form-group { margin-bottom: 20px; }
body input, body select, body textarea { max-width: 100%; }
body .modern-footer { margin-top: 0 !important; }

/* Resources: modern document library */
body.resources-page {
    background: #fff;
    color: var(--site-ink);
}

body.resources-page .page-header {
    min-height: 410px;
    padding-top: 168px !important;
    padding-bottom: 72px !important;
    display: flex;
    align-items: center;
    background:
        linear-gradient(110deg, rgba(13,43,90,.96), rgba(26,74,140,.88)),
        url('../images/2.jpeg') center 45% / cover no-repeat !important;
    text-align: left;
}

body.resources-page .page-header::before {
    height: 4px;
    background: #57b9ed;
}

body.resources-page .page-header h1 {
    max-width: 760px;
    font-size: clamp(2.35rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.035em;
    text-shadow: none;
}

body.resources-page .page-header p {
    max-width: 680px;
    margin: 16px 0 0;
    font-size: clamp(1rem, 1.6vw, 1.16rem);
    line-height: 1.7;
}

body.resources-page .resources-library {
    background: #fff;
}

body.resources-page .resources-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 30px;
    margin-bottom: 34px;
}

body.resources-page .resources-intro .section-header {
    margin: 0 !important;
    text-align: left;
}

body.resources-page .resources-intro .section-header h2 {
    display: block;
    padding: 0;
    color: var(--site-navy);
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    line-height: 1.15;
    letter-spacing: -.025em;
}

body.resources-page .resources-intro .section-header h2::after { display: none; }
body.resources-page .resources-intro .section-header p.subtitle {
    max-width: 720px;
    margin: 12px 0 0;
    color: var(--site-text);
}

body.resources-page .resources-count {
    min-width: 120px;
    padding: 14px 18px;
    border: 1px solid var(--site-line);
    border-radius: 12px;
    background: var(--site-surface);
    color: var(--site-text);
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
}

body.resources-page .resources-count strong {
    display: block;
    color: var(--site-navy);
    font-size: 1.45rem;
    line-height: 1.1;
}

body.resources-page .filter-panel {
    margin-bottom: 34px;
    padding: 16px;
    border: 1px solid var(--site-line);
    border-radius: 14px;
    background: var(--site-surface);
}

body.resources-page .filter-label {
    display: block;
    margin: 0 0 10px 4px;
    color: var(--site-text);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.resources-page .filter-controls {
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
}

body.resources-page .filter-btn {
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid #b9c9da;
    border-radius: 9px;
    background: #fff;
    color: var(--site-navy);
    font-size: .88rem;
    font-weight: 650;
}

body.resources-page .filter-btn:hover,
body.resources-page .filter-btn.active {
    border-color: var(--site-blue);
    background: var(--site-blue);
    color: #fff;
}

body.resources-page .resources-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px !important;
}

body.resources-page .resource-card {
    --resource-accent: var(--site-blue);
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--site-line);
    border-top: 4px solid var(--resource-accent);
    border-radius: var(--site-radius);
    background: #fff;
    box-shadow: 0 7px 24px rgba(13,43,90,.07);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

body.resources-page .resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--site-shadow);
}

body.resources-page .resource-header {
    padding: 24px 24px 12px;
    background: #fff !important;
    color: var(--site-ink);
    align-items: flex-start;
    gap: 14px;
}

body.resources-page .resource-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--resource-accent) 12%, white);
    color: var(--resource-accent);
    font-size: 1.35rem;
}

body.resources-page .resource-heading {
    min-width: 0;
    flex: 1;
}

body.resources-page .resource-category {
    position: static;
    display: inline-flex;
    max-width: 100%;
    margin-bottom: 7px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--site-sky);
    color: var(--site-blue);
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .055em;
    line-height: 1.4;
    text-transform: uppercase;
}

body.resources-page .resource-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--site-ink);
    font-size: 1.08rem;
    line-height: 1.38;
    overflow-wrap: anywhere;
}

body.resources-page .resource-body {
    flex: 1;
    padding: 10px 24px 20px;
}

body.resources-page .resource-description {
    display: -webkit-box;
    min-height: 4.8em;
    margin: 0 0 18px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--site-text);
    font-size: .92rem;
    line-height: 1.6;
}

body.resources-page .resource-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 7px;
    margin: 0;
    padding: 0;
    background: transparent;
}

body.resources-page .meta-item {
    min-width: 0;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--site-surface);
    color: var(--site-text);
    font-size: .77rem;
    white-space: nowrap;
}

body.resources-page .meta-item i { color: var(--site-blue); }

body.resources-page .resource-footer {
    gap: 14px;
    padding: 16px 24px 22px;
    border-top: 1px solid #edf1f5;
    background: #fff;
}

body.resources-page .resource-date {
    color: var(--site-text);
    font-size: .78rem;
}

body.resources-page .download-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 9px;
    background: var(--site-blue);
    font-size: .84rem;
}

body.resources-page .download-btn:hover { background: var(--site-navy); }

body.resources-page .download-btn.unavailable {
    border: 1px solid #d8dee8;
    background: #eef1f5;
    color: #707b8c;
    cursor: not-allowed;
}

body.resources-page .empty-state {
    padding: 60px 24px;
    border: 1px dashed #b9c9da;
    border-radius: var(--site-radius);
    background: var(--site-surface);
}

@media (max-width: 1000px) {
    body.resources-page .resources-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    body .container,
    body .mcs-container,
    body .container-main { width: min(calc(100% - 32px), var(--site-container)); }

    body.resources-page .page-header {
        min-height: 310px;
        padding: 122px 16px 52px !important;
    }

    body.resources-page .resources-intro { grid-template-columns: 1fr; gap: 18px; }
    body.resources-page .resources-count { justify-self: start; }
    body.resources-page .resources-grid { grid-template-columns: 1fr; }
    body.resources-page .resource-header { flex-direction: row; text-align: left; }
    body.resources-page .resource-meta { flex-direction: row; align-items: center; }
    body.resources-page .filter-controls { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    body.resources-page .filter-btn { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    body *, body *::before, body *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Homepage section rhythm and service platforms */
body .services-section {
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(120deg, rgba(7,39,82,.96), rgba(16,100,166,.88)),
        url('../images/editorial/fisher-at-sea.jpg') center 58% / cover no-repeat !important;
    color: #fff;
}

body .services-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 85% 15%, rgba(79,190,240,.3), transparent 34%);
}

body .services-section .section-title,
body .services-section .section-subtitle { color: #fff; }
body .services-section .section-subtitle { opacity: .82; }

body .services-section .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 1050px;
    margin-inline: auto;
}

body .services-section .service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 490px;
    padding: clamp(28px, 4vw, 48px) !important;
    border: 1px solid rgba(255,255,255,.75) !important;
    border-radius: 22px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 22px 50px rgba(3,24,55,.22) !important;
    color: var(--site-text);
    text-align: center;
}

body .services-section .service-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 105px;
    margin-bottom: 22px;
}

body .services-section .service-brand img {
    max-width: 118px;
    max-height: 98px;
    object-fit: contain;
}

body .services-section .service-brand.somturk-brand img { max-width: 180px; }
body .services-section .service-card h3 { margin: 0 0 5px; color: var(--site-ink); font-size: clamp(1.45rem, 2.4vw, 2rem); }
body .services-section .service-card h4 { margin: 0 0 16px; color: var(--site-blue); font-size: .92rem; font-weight: 750; }
body .services-section .service-card p { flex: 1; max-width: 470px; color: var(--site-text); line-height: 1.7; }
body .services-section .service-card .btn { margin-top: 18px; }

body .leadership-section {
    background: #eaf4ff !important;
}

body .leadership-section .leadership-card {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 24px;
    background:
        linear-gradient(90deg, rgba(5,26,58,.92) 0%, rgba(5,26,58,.68) 48%, rgba(5,26,58,.15) 82%),
        var(--leader-photo) center 22% / cover no-repeat !important;
    box-shadow: 0 18px 45px rgba(13,43,90,.2);
}

body .leadership-section .leader-info {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    padding: clamp(32px, 6vw, 72px) !important;
    background: transparent !important;
}

body .leadership-section .leader-info h3,
body .leadership-section .leader-info h4,
body .leadership-section .leader-info p { color: #fff !important; }
body .leadership-section .leader-info h4 { color: #7dd3fc !important; }
body .leadership-section .leader-info .btn { background: #fff !important; color: var(--site-navy) !important; }
body .news-section { background: #f7fbff !important; }

/* Services page platform cards */
body .services-pro { background: #eaf4ff !important; }
body .services-pro .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1080px; margin-inline: auto; }
body .service-pro-card { display: flex; flex-direction: column; align-items: center; height: 100%; padding: clamp(28px, 4vw, 46px) !important; border: 1px solid var(--site-line) !important; border-radius: 22px !important; box-shadow: var(--site-shadow) !important; text-align: center; }
body .service-pro-card .service-logo { height: 110px; display: flex; align-items: center; justify-content: center; }
body .service-pro-card .service-logo img { max-width: 180px; max-height: 100px; object-fit: contain; }
body .service-pro-card h3 { margin: 16px 0 5px; }
body .service-pro-card .service-audience { margin: 0 0 16px; color: var(--site-blue); font-size: .92rem; }
body .service-pro-card .service-desc { flex: 1; max-width: 490px; line-height: 1.7; }

/* Contact and feedback module inspired by the BADMAAL interaction pattern */
body.contact-page { background: #f4f8fc; }
body.contact-page .contact-hub { background: #f4f8fc; }
body.contact-page .contact-hub-grid { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(0, 1.4fr); gap: clamp(24px, 4vw, 48px); align-items: stretch; }
body.contact-page .dg-contact-card {
    padding: clamp(28px, 4vw, 44px);
    border-radius: 22px;
    background: linear-gradient(145deg, #0d2b5a, #1a5d9d);
    color: #fff;
    box-shadow: 0 18px 45px rgba(13,43,90,.18);
}
body.contact-page .contact-eyebrow { display: block; margin-bottom: 28px; color: #8bd8ff; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body.contact-page .dg-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 26px; border-radius: 16px; background: rgba(255,255,255,.12); color: #fff; font-size: 1.45rem; }
body.contact-page .dg-contact-card h2 { margin: 0 0 14px; color: #fff; font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.18; }
body.contact-page .dg-contact-card > p { color: rgba(255,255,255,.76); line-height: 1.7; }
body.contact-page .dg-contact-list { display: grid; gap: 10px; margin-top: 30px; }
body.contact-page .dg-contact-list a,
body.contact-page .dg-contact-list div { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
body.contact-page .dg-contact-list i { width: 18px; margin-top: 4px; color: #8bd8ff; text-align: center; }
body.contact-page .form-container { width: 100%; max-width: none; margin: 0; }
body.contact-page .form-card { height: 100%; padding: clamp(28px, 4vw, 46px) !important; border: 1px solid var(--site-line); border-radius: 22px; background: #fff; box-shadow: var(--site-shadow); }
body.contact-page .form-card .section-header { text-align: left; }
body.contact-page .form-card .section-header h2 { display: block; padding: 0; }
body.contact-page .form-card .section-header h2::after { display: none; }
body.contact-page .form-card .section-header p { margin-left: 0; }
body.contact-page .location-grid { align-items: stretch; }
body.contact-page .location-info,
body.contact-page .map-placeholder { border-radius: 18px !important; overflow: hidden; }

@media (max-width: 820px) {
    body .services-section .services-grid,
    body .services-pro .services-grid,
    body.contact-page .contact-hub-grid { grid-template-columns: 1fr; }
    body .services-section .service-card { min-height: 0; }
    body .leadership-section .leadership-card { min-height: 620px; background-position: 62% center !important; }
    body .leadership-section .leader-info { background: linear-gradient(0deg, rgba(5,26,58,.95), rgba(5,26,58,.3)) !important; }
}

/* Leadership: dependable split card using the original minister portrait */
body .leadership-section .leadership-card {
    min-height: 390px;
    display: grid !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    align-items: stretch;
    border: 1px solid #e1e6ed;
    background: #fff !important;
    box-shadow: 0 14px 36px rgba(13,43,90,.09);
}

body .leadership-section .leader-info {
    width: 100%;
    align-self: center;
    padding: clamp(30px, 4vw, 50px) !important;
}

body .leadership-section .leader-info h3 { color: var(--site-ink) !important; }
body .leadership-section .leader-info h4 { color: var(--site-blue) !important; }
body .leadership-section .leader-info p { color: var(--site-text) !important; }
body .leadership-section .leader-info .btn { background: var(--site-navy) !important; color: #fff !important; }

body .leadership-section .leader-photo {
    width: auto !important;
    height: auto !important;
    min-height: 340px;
    margin: 24px 24px 24px 0 !important;
    border-radius: 20px !important;
    overflow: hidden;
}

body .leadership-section .leader-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
}

/* Compact contact page */
body.contact-page .page-header {
    padding-top: 138px !important;
    padding-bottom: 38px !important;
}

body.contact-page .page-header h1 { font-size: clamp(2rem, 4vw, 3rem); }
body.contact-page .page-header p { font-size: 1rem; }
body.contact-page .contact-hub { padding-top: 46px !important; padding-bottom: 56px !important; }
body.contact-page .contact-hub-grid { grid-template-columns: minmax(240px, .62fr) minmax(0, 1.5fr); gap: 26px; align-items: start; }
body.contact-page .dg-contact-card { align-self: start; height: auto; padding: 28px; }
body.contact-page .contact-eyebrow { margin-bottom: 18px; font-size: .68rem; }
body.contact-page .dg-icon { width: 48px; height: 48px; margin-bottom: 18px; font-size: 1.1rem; }
body.contact-page .dg-contact-card h2 { font-size: clamp(1.28rem, 2vw, 1.7rem); line-height: 1.25; }
body.contact-page .dg-contact-card > p { font-size: .88rem; line-height: 1.55; }
body.contact-page .dg-contact-list { margin-top: 20px; }
body.contact-page .dg-contact-list a { padding: 11px 12px; font-size: .86rem; }
body.contact-page .form-card { padding: clamp(24px, 3vw, 34px) !important; }
body.contact-page .form-card .section-header { margin-bottom: 24px !important; }
body.contact-page .form-card .section-header h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); }
body.contact-page .form-card .section-header p { font-size: .9rem; }
body.contact-page .form-grid { gap: 14px; }
body.contact-page .form-group { margin-bottom: 14px; }
body.contact-page .form-label { margin-bottom: 5px; font-size: .82rem; }
body.contact-page .form-control { min-height: 42px; padding: 10px 12px; font-size: .9rem; }
body.contact-page textarea.form-control { min-height: 105px; }

/* Compact two-row latest-updates ticker */
body .news-marquee-board { display: grid; gap: 16px; width: 100%; overflow: hidden; padding: 6px 0 12px; }
body .news-marquee-row {
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}
body .news-marquee-track {
    display: flex;
    width: max-content;
    gap: 16px;
    animation: mfbe-news-scroll 34s linear infinite;
    will-change: transform;
}
body .news-marquee-row.reverse .news-marquee-track { animation-direction: reverse; }
body .news-marquee-row:hover .news-marquee-track { animation-play-state: paused; }
body .news-marquee-track .news-card {
    flex: 0 0 330px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 118px;
    border: 1px solid var(--site-line);
    border-radius: 13px !important;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(13,43,90,.06);
}
body .news-marquee-track .card-image-container { height: 100%; min-height: 118px; }
body .news-marquee-track .card-img { width: 100%; height: 100%; object-fit: cover; }
body .news-marquee-track .news-content { min-width: 0; padding: 13px !important; }
body .news-marquee-track .news-title {
    display: -webkit-box;
    margin: 0 0 7px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: .9rem !important;
    line-height: 1.35;
}
body .news-marquee-track .news-excerpt { display: none; }
body .news-marquee-track .news-meta { display: block; margin: 0; font-size: .68rem; }
body .news-marquee-track .news-date { display: block; }
body .news-marquee-track .time-ago { display: none; }
body .news-marquee-track .news-read { display: block; margin-top: 6px; color: var(--site-blue); font-size: .72rem; }
body .news-marquee-track .status-badge { padding: 2px 6px; font-size: .62rem; }

@keyframes mfbe-news-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 8px)); }
}

/* Simplified footer */
body .modern-footer .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
body .modern-footer .footer-bottom-content { justify-content: center; text-align: center; }
body .modern-footer .copyright { width: 100%; text-align: center; }

@media (max-width: 820px) {
    body .leadership-section .leadership-card { grid-template-columns: 1fr; }
    body .leadership-section .leader-photo { min-height: 360px; margin: 18px 18px 0 !important; grid-row: 1; }
    body .leadership-section .leader-info { grid-row: 2; }
    body.contact-page .contact-hub-grid { grid-template-columns: 1fr; }
    body .modern-footer .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    body .news-marquee-track .news-card { flex-basis: 285px; grid-template-columns: 94px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    body .news-marquee-track { animation-play-state: paused; }
}
