/* =========================================================
   MERT DEMIREL — GLOBAL DESIGN FOUNDATION
   Edit these tokens once; all pages inherit them.
   ========================================================= */

:root {
    /* Brand palette — change here, not inside individual pages. */
    --md-brand: #264032;
    --md-brand-soft: #446353;
    --md-accent: #c8ac9a;
    --md-accent-deep: #7d6455;
    --md-logo-brown: #C1A36C;
    --md-bg: #f4f1ec;
    --md-surface: #ffffff;
    --md-text: #18231d;
    --md-muted: #6f6c67;
    --md-line: rgba(24, 35, 29, 0.14);
    --md-dark: #101a14;
    --md-light: #f7f5f1;
    --md-cream: #f4f1ec;
    --md-mist: #dbe5dd;

    /* Footer palette — derived only from approved DMD brand tokens. */
    --md-footer-bg: var(--md-dark);
    --md-footer-bg-alt: var(--md-brand);
    --md-footer-text: #ffffff;
    --md-footer-muted: color-mix(in srgb, var(--md-footer-text) 72%, var(--md-brand) 28%);
    --md-footer-muted-soft: color-mix(in srgb, var(--md-footer-text) 56%, var(--md-brand) 44%);
    --md-footer-line: color-mix(in srgb, var(--md-footer-text) 13%, transparent);
    --md-footer-line-soft: color-mix(in srgb, var(--md-footer-text) 9%, transparent);
    --md-footer-hover-bg: color-mix(in srgb, var(--md-footer-text) 5%, transparent);

    /* Global typography — all story pages inherit these. */
    --md-font-body: "Inter", Arial, Helvetica, sans-serif;
    --md-font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --md-font-ui: "Manrope", Arial, Helvetica, sans-serif;

    --md-container: 1440px;
    --md-gutter: clamp(20px, 4vw, 64px);
    --md-header-height: 84px;

    --md-space-1: 8px;
    --md-space-2: 16px;
    --md-space-3: 24px;
    --md-space-4: 40px;
    --md-space-5: 64px;
    --md-space-6: 96px;
    --md-space-7: 144px;

    --md-ease: cubic-bezier(.22, 1, .36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--md-bg);
    color: var(--md-text);
    font-family: var(--md-font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.menu-open {
    overflow: hidden;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: .16em;
}

button,
input,
textarea,
select {
    font: inherit;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
    margin-top: 0;
}

.site-main {
    min-height: 50vh;
}

.md-container {
    width: min(100% - (var(--md-gutter) * 2), var(--md-container));
    margin-inline: auto;
}

.md-default-content {
    padding-block: clamp(72px, 10vw, 160px);
}

.md-default-content h1,
.md-default-content h2,
.md-default-content h3 {
    font-family: var(--md-font-display);
    font-weight: 400;
    line-height: 1.05;
}

.md-eyebrow {
    margin-bottom: 18px;
    color: var(--md-muted);
    font-size: 12px;
    line-height: 1;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.md-link {
    display: inline-block;
    border-bottom: 1px solid currentColor;
    text-decoration: none;
}

/* Header */
.site-header {
    position: relative;
    z-index: 100;
    width: 100%;
    border-bottom: 1px solid var(--md-line);
    background: color-mix(in srgb, var(--md-bg) 94%, transparent);
}

.site-header__inner {
    min-height: var(--md-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.site-branding a {
    color: inherit;
    text-decoration: none;
}

.site-branding__text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.custom-logo-link img {
    width: auto;
    max-height: 48px;
}

.site-nav__menu,
.site-footer__menu {
    display: flex;
    align-items: center;
    gap: clamp(18px, 2.5vw, 38px);
    padding: 0;
    margin: 0;
    list-style: none;
}

.site-nav__menu a,
.site-footer__menu a {
    color: inherit;
    font-size: 13px;
    text-decoration: none;
}

.site-nav__menu a:hover,
.site-footer__menu a:hover {
    opacity: .58;
}

.menu-toggle {
    display: none;
    border: 0;
    padding: 8px 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.menu-toggle__label {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--md-line);
    padding-block: 48px;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px 48px;
    align-items: start;
}

.site-footer__brand a {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-footer__copyright {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--md-muted);
    font-size: 12px;
}

/* Accessibility */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    position: fixed;
    z-index: 9999;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    clip: auto;
    padding: 10px 14px;
    margin: 0;
    background: #fff;
    color: #000;
}

@media (max-width: 860px) {
    :root {
        --md-header-height: 72px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .site-nav {
        position: fixed;
        inset: var(--md-header-height) 0 0;
        display: none;
        background: var(--md-bg);
        padding: 32px var(--md-gutter);
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav__menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .site-nav__menu a {
        font-family: var(--md-font-display);
        font-size: clamp(30px, 9vw, 52px);
        line-height: 1;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* =========================================================
   STORY PAGE — FULL BLEED CONTRACT
   WordPress remains the CMS shell; story pages own the full viewport.
   ========================================================= */
body.md-page-about .site-main,
body.md-page-credentials .site-main,
body.md-page-academic-research .site-main,
body.md-page-approach .site-main,
body.md-page-home .site-main,
body.md-page-contact .site-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: clip;
}

body.md-page-about .site-main > .md-long-about,
body.md-page-credentials .site-main > .md-competencies,
body.md-page-academic-research .site-main > .md-v2,
body.md-page-approach .site-main > [class*="md-"],
body.md-page-home .site-main > [class*="md-"],
body.md-page-contact .site-main > .mdc-contact-story {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Prevent classic-editor leftovers from creating phantom spacing around raw story markup. */
body.md-page-about .site-main > br:first-child,
body.md-page-credentials .site-main > br:first-child,
body.md-page-academic-research .site-main > br:first-child,
body.md-page-approach .site-main > br:first-child,
body.md-page-contact .site-main > br:first-child,
body.md-page-about .site-main > br:last-child,
body.md-page-credentials .site-main > br:last-child,
body.md-page-academic-research .site-main > br:last-child,
body.md-page-approach .site-main > br:last-child,
body.md-page-contact .site-main > br:last-child {
    display: none;
}


/* =========================================================
   DMD MOTION SYSTEM — v1.22.0
   One restrained motion language across shared templates.
   ========================================================= */
:root {
    --md-motion-fast: 180ms;
    --md-motion-ui: 280ms;
    --md-motion-base: 420ms;
    --md-motion-reveal: 720ms;
    --md-motion-slow: 900ms;
    --md-motion-distance: 22px;
    --md-motion-distance-mobile: 14px;
    --md-motion-stagger: 55ms;
    --md-motion-ease: var(--md-ease);
}

.md-global-progress {
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}
.md-global-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--md-accent-deep);
    transform: scaleX(0);
    transform-origin: 0 50%;
    will-change: transform;
}
html[dir="rtl"] .md-global-progress span {
    transform-origin: 100% 50%;
}

.md-procedure-progress,
.md-body-area-progress,
.md-concern-progress,
.md-treatment-progress,
.md-location-progress,
.dmd-cluster-progress,
.dmd-pcluster-progress,
.md-reading-progress,
.md-journal-progress,
.md-archive-progress,
.mdh-progress,
.mdc-progress,
.mdcs-progress,
.md-approach .md-progress,
.md-competencies .md-progress,
.md-long-about .progress {
    display: none !important;
}

html.md-motion-enabled .md-motion-reveal {
    opacity: 0;
    transform: translate3d(0, var(--md-motion-distance), 0);
    transition:
        opacity var(--md-motion-reveal) var(--md-motion-ease),
        transform var(--md-motion-reveal) var(--md-motion-ease);
    transition-delay: var(--md-motion-delay, 0ms);
    will-change: opacity, transform;
}
html.md-motion-enabled .md-motion-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

html:not(.md-reduced-motion) :is(
    .md-journal-reveal,
    .md-archive-reveal,
    .md-video-reveal,
    .dmd-pcluster-reveal,
    .mdh-reveal,
    .mdc-reveal,
    .mdcs-reveal,
    .md-approach .md-reveal,
    .md-competencies .md-reveal,
    .md-long-about .reveal
) {
    transform: translate3d(0, var(--md-motion-distance), 0);
    transition-duration: var(--md-motion-reveal);
    transition-timing-function: var(--md-motion-ease);
}
html:not(.md-reduced-motion) :is(
    .md-journal-reveal,
    .md-archive-reveal,
    .md-video-reveal,
    .dmd-pcluster-reveal,
    .mdh-reveal,
    .mdc-reveal,
    .mdcs-reveal,
    .md-approach .md-reveal,
    .md-competencies .md-reveal,
    .md-long-about .reveal
).is-visible {
    transform: translate3d(0, 0, 0);
}

@media (hover:hover) and (pointer:fine) {
    :is(
        .md-procedure-fact,
        .md-concern-question-card,
        .md-body-area-lens__grid > *,
        .md-treatment-snapshot__grid > *,
        .md-location-context__cards > *,
        .dmd-cluster-chapter,
        .dmd-cluster-item,
        .md-gallery-card
    ) {
        transition:
            transform var(--md-motion-ui) var(--md-motion-ease),
            box-shadow var(--md-motion-ui) var(--md-motion-ease),
            border-color var(--md-motion-ui) ease,
            background-color var(--md-motion-ui) ease;
    }

    :is(
        .md-procedure-fact,
        .md-concern-question-card,
        .md-body-area-lens__grid > *,
        .md-treatment-snapshot__grid > *,
        .md-location-context__cards > *,
        .dmd-cluster-chapter,
        .dmd-cluster-item,
        .md-gallery-card
    ):hover {
        transform: translate3d(0, -3px, 0);
    }
}

@media (max-width: 700px) {
    html.md-motion-enabled .md-motion-reveal,
    html:not(.md-reduced-motion) :is(
        .md-journal-reveal,
        .md-archive-reveal,
        .md-video-reveal,
        .dmd-pcluster-reveal,
        .mdh-reveal,
        .mdc-reveal,
        .mdcs-reveal,
        .md-approach .md-reveal,
        .md-competencies .md-reveal,
        .md-long-about .reveal
    ) {
        transform: translate3d(0, var(--md-motion-distance-mobile), 0);
    }

    html.md-motion-enabled .md-motion-reveal.is-visible,
    html:not(.md-reduced-motion) :is(
        .md-journal-reveal,
        .md-archive-reveal,
        .md-video-reveal,
        .dmd-pcluster-reveal,
        .mdh-reveal,
        .mdc-reveal,
        .mdcs-reveal,
        .md-approach .md-reveal,
        .md-competencies .md-reveal,
        .md-long-about .reveal
    ).is-visible {
        transform: translate3d(0, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .md-motion-reveal,
    .md-journal-reveal,
    .md-archive-reveal,
    .md-video-reveal,
    .dmd-pcluster-reveal,
    .mdh-reveal,
    .mdc-reveal,
    .mdcs-reveal,
    .md-approach .md-reveal,
    .md-competencies .md-reveal,
    .md-long-about .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .md-global-progress span {
        will-change: auto;
    }
}
