/*
Theme Name: dds_mildgram.com
Theme URI: https://mildgram.com/
Author: Nathan Cross
Description: Editorial theme for Mildgram — visual content strategies for real estate professionals: property photography, video walkthroughs, virtual tours and social media presentation.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mildgram
*/

/* ---------- Tokens ---------- */
:root {
    --mg-paper: #F7F5F2;
    --mg-sand: #EDE9E3;
    --mg-side: #F0ECE6;
    --mg-navy: #1B2A41;
    --mg-blue: #2E5A88;
    --mg-copper: #B87333;
    --mg-copper-dark: #9A5F2A;
    --mg-copper-light: #D69A61;
    --mg-muted: #6B7A8F;
    --mg-rule: #D8D2CA;
    --mg-hatch: #E8E2DA;
    --mg-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --mg-sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- [hidden] guards (before component styles) ---------- */
.cookie-banner[hidden] { display: none !important; }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--mg-sans);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--mg-navy);
    background-color: var(--mg-paper);
    background-image: repeating-linear-gradient(45deg, transparent 0, transparent 19.5px, var(--mg-hatch) 19.5px, var(--mg-hatch) 20px);
}

p { margin: 0 0 1.1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--mg-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--mg-navy);
    margin: 1.6em 0 0.6em;
    overflow-wrap: break-word;
    hyphens: auto;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

p, li, dd, td, th, blockquote, figcaption, .card-body, .widget, .mg-step__text {
    overflow-wrap: break-word;
    hyphens: auto;
}

img { max-width: 100%; height: auto; }

a {
    color: var(--mg-copper);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: background-size 0.3s ease, color 0.2s ease;
}
a:hover, a:focus-visible { background-size: 100% 1px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--mg-copper);
    outline-offset: 2px;
}

table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; border: 1px solid var(--mg-rule); }
th, td { border: 1px solid var(--mg-rule); padding: 0.6em 0.8em; text-align: start; vertical-align: top; }
th { background: var(--mg-sand); font-weight: 600; }

blockquote {
    margin: 1.6em 0;
    padding: 1.2em 1.6em;
    border-inline-start: 3px solid var(--mg-copper);
    background: var(--mg-sand);
    font-family: var(--mg-serif);
    font-size: 1.2rem;
    font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

pre { overflow-x: auto; background: #fff; padding: 1em; border: 1px solid var(--mg-rule); }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.skip-link {
    position: absolute;
    top: -60px; left: 1rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--mg-copper);
    color: #fff;
}
.skip-link:focus { top: 1rem; }

/* ---------- Container ---------- */
.shell { width: min(92%, 1180px); margin-inline: auto; }
.shell--narrow { width: min(85%, 1180px); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border: 1.5px solid var(--mg-copper);
    border-radius: 2px;
    background: var(--mg-copper);
    background-image: none;
    color: #fff;
    font-family: var(--mg-sans);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.btn:hover, .btn:focus-visible {
    background-color: var(--mg-copper-dark);
    border-color: var(--mg-copper-dark);
    color: #fff;
    transform: translateY(-1px);
}
.btn--ghost { background: transparent; color: var(--mg-copper); }
.btn--ghost:hover, .btn--ghost:focus-visible { background-color: var(--mg-copper); border-color: var(--mg-copper); color: #fff; }

/* ---------- Top line & header ---------- */
.mg-topline { height: 3px; background: var(--mg-copper); }

.mg-header { background: var(--mg-navy); color: #F2EEE8; }
.mg-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.1rem 0;
}
.mg-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1 1 auto;
    color: #F2EEE8;
    background-image: none;
}
.mg-brand:hover { color: #fff; }
.mg-brand__mark { flex: 0 0 auto; display: block; width: 52px; height: 52px; }
.mg-brand__mark svg, .mg-brand__mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mg-brand__text { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; max-width: 620px; }
.mg-brand__name {
    font-family: var(--mg-serif);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mg-brand__desc {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #A9B4C4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.8rem; }
.mg-nav__list li { position: relative; }
.mg-nav__list a {
    display: inline-block;
    padding: 0.35rem 0;
    color: #F2EEE8;
    font-size: 0.95rem;
    font-weight: 500;
    background-size: 0 1px;
}
.mg-nav__list a:hover, .mg-nav__list .current-menu-item > a { color: var(--mg-copper-light); background-size: 100% 1px; }
.mg-nav__list .sub-menu { list-style: none; margin: 0; padding: 0.5rem 0; position: absolute; top: 100%; left: 0; min-width: 200px; background: var(--mg-navy); border-top: 2px solid var(--mg-copper); display: none; z-index: 20; }
.mg-nav__list li:hover > .sub-menu, .mg-nav__list li:focus-within > .sub-menu { display: block; }
.mg-nav__list .sub-menu a { padding: 0.4rem 1rem; }

.mg-nav-toggle {
    display: none;
    flex: 0 0 auto;
    width: 44px; height: 44px;
    border: 1.5px solid var(--mg-copper);
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    padding: 0;
    position: relative;
}
.mg-nav-toggle__bar { display: block; width: 20px; height: 1.5px; margin: 4px auto; background: #F2EEE8; transition: transform 0.25s ease, opacity 0.25s ease; }
.mg-nav-toggle[aria-expanded="true"] .mg-nav-toggle__bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.mg-nav-toggle[aria-expanded="true"] .mg-nav-toggle__bar:nth-child(2) { opacity: 0; }
.mg-nav-toggle[aria-expanded="true"] .mg-nav-toggle__bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Section titles ---------- */
.mg-section-title {
    position: relative;
    margin: 0 0 2.6rem;
    padding: 0 0 0.9rem 1.1rem;
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    text-align: start;
}
.mg-section-title::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: calc(0.9rem + 0.35em);
    width: 6px; height: 6px;
    background: var(--mg-copper);
}
.mg-section-title::after {
    content: "";
    position: absolute;
    left: 1.1rem;
    bottom: 0;
    width: 40%;
    height: 1px;
    background: var(--mg-copper);
}
.mg-section-lead { max-width: 62ch; color: var(--mg-muted); margin: -1.4rem 0 2.6rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--mg-muted);
    padding: 1.6rem 0 0;
    margin-bottom: 1.4rem;
    overflow-wrap: break-word;
}
.breadcrumbs a { color: var(--mg-copper); }
.breadcrumbs .sep { color: var(--mg-rule); margin: 0 0.35rem; }

/* ---------- Layouts ---------- */
.mg-main { display: block; }
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    column-gap: 6%;
    align-items: start;
    padding-bottom: 5rem;
}
.layout-single { display: block; padding-bottom: 5rem; }
.layout-single .content-area { width: 85%; margin-left: auto; margin-right: auto; }
.content-area { min-width: 0; }

.mg-page-head { margin-bottom: 2.4rem; }
.mg-page-head h1 { margin: 0 0 0.6rem; }
.mg-page-head p { color: var(--mg-muted); margin: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
    min-width: 0;
    background: var(--mg-side);
    padding: 2rem 1.6rem;
    border-top: 2px solid var(--mg-copper);
    color: var(--mg-navy);
}
.sidebar .widget { margin-bottom: 2.2rem; color: var(--mg-navy); }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title { margin: 0 0 1rem; font-size: 1.2rem; color: var(--mg-navy); padding-left: 0.9rem; position: relative; }
.sidebar .widget-title::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 6px; height: 6px; background: var(--mg-copper); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 0.6rem 0; border-bottom: 1px solid var(--mg-rule); line-height: 1.45; }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--mg-navy); }
.sidebar .widget a:hover { color: var(--mg-copper); }
.sidebar .widget .post-date { display: block; font-size: 0.8rem; color: var(--mg-muted); }

/* ---------- Cards ---------- */
.mg-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem 2.2rem;
}
.layout-with-sidebar .mg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 14px;
    border-bottom: 1px solid var(--mg-rule);
    border-radius: 0;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 30%;
    height: 2px;
    background: var(--mg-copper);
    transition: width 0.45s ease;
}
.card:hover::before, .card:focus-within::before { width: 100%; }

.card-media { position: relative; overflow: hidden; }
.card-media a { display: block; background-image: none; }
.card-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0;
}
.card-tag {
    position: absolute;
    top: 0.8rem; left: 0.8rem;
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--mg-copper);
    background: rgba(247, 245, 242, 0.94);
    color: var(--mg-copper);
    font-family: var(--mg-sans);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
    background-image: none;
}
a.card-tag:hover { background: var(--mg-copper); color: #fff; }

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.2rem 0 1.5rem;
}
.card-meta { font-size: 0.82rem; color: var(--mg-muted); margin-bottom: 0.4rem; }
.card-title { margin: 0 0 0.7rem; font-size: 1.35rem; line-height: 1.3; }
.card-title a { color: var(--mg-navy); background-size: 0 1px; }
.card-title a:hover { color: var(--mg-copper); }
.card-excerpt { font-size: 0.97rem; color: #3A4A60; margin-bottom: 1rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; align-self: flex-start; font-size: 0.9rem; font-weight: 500; }

.mg-empty { padding: 2rem 1.8rem; background: var(--mg-sand); border-inline-start: 3px solid var(--mg-copper); }

/* ---------- Pagination ---------- */
.mg-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3.5rem;
}
.mg-pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    height: 2.6rem;
    padding: 0 0.85rem;
    border: 1.5px solid var(--mg-rule);
    border-radius: 2px;
    background: transparent;
    background-image: none;
    color: var(--mg-navy);
    font-size: 0.92rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.mg-pager a.page-numbers:hover { border-color: var(--mg-copper); color: var(--mg-copper); }
.mg-pager .page-numbers.current { background: var(--mg-copper); border-color: var(--mg-copper); color: #fff; }
.mg-pager .page-numbers.dots { border: 0; min-width: auto; padding: 0 0.3rem; }

/* ---------- Front page ---------- */
.mg-section {
    position: relative;
    padding: 5.5rem 0;
    overflow: hidden;
}
.mg-section--paper { background: transparent; }
.mg-section--sand { background: var(--mg-sand); }
.mg-section--seam::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 4px;
    background: radial-gradient(circle, var(--mg-copper) 1px, transparent 1.4px) 0 50% / 8px 4px repeat-x;
}
.mg-section--glow::after {
    content: "";
    position: absolute;
    right: -140px;
    bottom: -140px;
    width: 420px;
    height: 420px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='100' fill='%23B87333'/%3E%3C/svg%3E") no-repeat center / contain;
    opacity: 0.05;
    pointer-events: none;
}
.mg-section > .shell { position: relative; z-index: 1; }
.mg-section-foot { margin-top: 3rem; }

/* Hero */
.mg-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 70vh;
    overflow: hidden;
    background: var(--mg-navy);
    color: #fff;
}
.mg-hero__img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mg-hero__veil {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background:
        linear-gradient(0deg, rgba(27, 42, 65, 0.85) 0%, rgba(27, 42, 65, 0) 45%),
        linear-gradient(100deg, rgba(27, 42, 65, 0.92) 0%, rgba(27, 42, 65, 0.72) 42%, rgba(46, 90, 136, 0.3) 100%);
}
.mg-hero__content {
    position: relative;
    z-index: 1;
    padding: 6rem 0 5.5rem;
}
.mg-hero__kicker { margin: 0 0 1.2rem; font-size: 0.95rem; color: var(--mg-copper-light); font-weight: 500; }
.mg-hero__title {
    margin: 0 0 1.4rem;
    max-width: 17ch;
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 600;
    line-height: 1.12;
}
.mg-hero__text { max-width: 54ch; margin: 0; font-size: 1.12rem; color: #D9DFE8; }
.mg-hero__mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3rem;
}
.mg-hero__mark::before { content: ""; width: 6px; height: 6px; background: var(--mg-copper); }
.mg-hero__mark::after { content: ""; width: 120px; height: 1px; background: var(--mg-copper); }

/* Topic grid */
.mg-topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem; }
.mg-topic .card-body { padding-bottom: 1.6rem; }
.mg-topic .card-title { font-size: 1.45rem; }

/* Quote */
.mg-quote {
    position: relative;
    padding: 6rem 1.5rem;
    color: #fff;
    background:
        repeating-linear-gradient(115deg, rgba(184, 115, 51, 0.16) 0, rgba(184, 115, 51, 0.16) 1px, transparent 1px, transparent 56px),
        linear-gradient(135deg, var(--mg-navy) 0%, var(--mg-blue) 100%);
    overflow: hidden;
}
.mg-quote::before, .mg-quote::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    background: radial-gradient(circle, var(--mg-copper) 1px, transparent 1.4px) 0 50% / 8px 4px repeat-x;
}
.mg-quote::before { top: 1.6rem; }
.mg-quote::after { bottom: 1.6rem; }
.mg-quote__fig {
    margin: 0 auto;
    max-width: 880px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 1.6rem;
    align-items: start;
    text-align: center;
}
.mg-quote__mark {
    font-family: var(--mg-serif);
    font-size: 5.5rem;
    line-height: 0.8;
    color: var(--mg-copper);
}
.mg-quote__mark--end { align-self: end; }
.mg-quote blockquote {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--mg-serif);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    font-style: normal;
    line-height: 1.4;
    color: #fff;
}
.mg-quote blockquote p { margin: 0; }
.mg-quote figcaption { grid-column: 1 / -1; margin-top: 1.8rem; font-size: 0.95rem; color: #9FB0C6; }

/* Steps */
.mg-steps {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0 0 0 2rem;
    max-width: 860px;
}
.mg-steps::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2.2rem;
    bottom: 2.2rem;
    width: 1px;
    background: var(--mg-copper);
}
.mg-step {
    position: relative;
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    column-gap: 1.6rem;
    padding: 2rem 0;
    border-top: 1px solid var(--mg-rule);
}
.mg-step:first-child { border-top: 0; }
.mg-step::before {
    content: "";
    position: absolute;
    left: calc(-2rem - 3px);
    top: 3.1rem;
    width: 7px;
    height: 7px;
    background: var(--mg-copper);
}
.mg-step__num {
    font-family: var(--mg-serif);
    font-size: 3.4rem;
    font-weight: 600;
    line-height: 1;
    color: var(--mg-copper);
}
.mg-step__title { margin: 0.3rem 0 0.5rem; font-size: 1.45rem; }
.mg-step__text { margin: 0; color: #3A4A60; }

/* ---------- Single & page ---------- */
.entry-header h1 { margin: 0 0 0.8rem; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: center; font-size: 0.88rem; color: var(--mg-muted); margin-bottom: 2rem; }
.entry-meta .mg-cats a {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    margin-right: 0.3rem;
    border: 1px solid var(--mg-copper);
    font-size: 0.75rem;
    background-image: none;
}
.entry-thumb { margin: 0 0 2.2rem; }
.entry-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.entry-content { font-size: 1.07rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { padding-left: 1rem; position: relative; }
.entry-content h2::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; background: var(--mg-copper); }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content img { display: block; }
.entry-content figure { margin: 1.8em 0; }
.entry-content figcaption { font-size: 0.85rem; color: var(--mg-muted); margin-top: 0.5rem; }
.entry-tags { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--mg-rule); font-size: 0.9rem; color: var(--mg-muted); }
.entry-tags a { margin-right: 0.6rem; }
.mg-post-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--mg-rule); }
.mg-post-nav__item span { display: block; font-size: 0.8rem; color: var(--mg-muted); }
.mg-post-nav__item a { font-family: var(--mg-serif); font-size: 1.1rem; }
.mg-post-nav__item--next { text-align: end; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 4rem; padding-top: 2.4rem; border-top: 1px solid var(--mg-rule); }
.comments-title { margin-top: 0; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-inline-start: 2rem; }
.mg-comment__body { padding: 1.4rem 0; border-bottom: 1px solid var(--mg-rule); }
.mg-comment__head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.7rem; }
.mg-comment__head img { display: block; border-radius: 0; }
.mg-comment__who { display: flex; flex-direction: column; line-height: 1.3; }
.mg-comment__author { font-weight: 600; }
.mg-comment__who time { font-size: 0.8rem; color: var(--mg-muted); }
.mg-comment__pending { font-size: 0.88rem; color: var(--mg-copper-dark); }
.mg-comment__reply a { font-size: 0.88rem; font-weight: 500; }
.comment-respond { margin-top: 2.4rem; padding: 2rem 1.8rem; background: var(--mg-sand); }
.comment-reply-title { margin-top: 0; }
.comment-reply-title small { font-family: var(--mg-sans); font-size: 0.85rem; margin-left: 0.6rem; }
.comment-form label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 0.3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--mg-rule);
    border-radius: 2px;
    background: #fff;
    font: inherit;
    color: var(--mg-navy);
}
.comment-form-cookies-consent { display: flex; gap: 0.6rem; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; margin: 0; }
.comment-form .submit {
    padding: 0.8rem 1.6rem;
    border: 1.5px solid var(--mg-copper);
    border-radius: 2px;
    background: var(--mg-copper);
    color: #fff;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}
.comment-form .submit:hover { background: var(--mg-copper-dark); border-color: var(--mg-copper-dark); transform: translateY(-1px); }

/* ---------- Search form ---------- */
.mg-search { display: flex; gap: 0.5rem; max-width: 520px; }
.mg-search__field {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 0.9rem;
    border: 1.5px solid var(--mg-rule);
    border-radius: 2px;
    background: #fff;
    font: inherit;
    color: var(--mg-navy);
}
.mg-search__field:focus { border-color: var(--mg-copper); outline: none; }
.mg-search .btn { flex: 0 0 auto; }

/* ---------- 404 ---------- */
.mg-404 { padding: 2rem 0 6rem; }
.mg-404__code { font-family: var(--mg-serif); font-size: clamp(4rem, 12vw, 8rem); line-height: 1; color: var(--mg-copper); margin: 0 0 0.5rem; }
.mg-404 h1 { margin-top: 0; }
.mg-404 .mg-search { margin: 2rem 0; }

/* ---------- Footer ---------- */
.mg-footer {
    background: var(--mg-navy);
    color: #D7DDE6;
    border-top: 3px solid var(--mg-copper);
}
.mg-footer__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
    padding: 4.5rem 0 3.5rem;
}
.mg-footer .widget { color: #D7DDE6; font-size: 0.95rem; }
.mg-footer .widget p { color: #D7DDE6; }
.mg-footer .widget-title { margin: 0 0 1.1rem; font-size: 1.25rem; color: #FFFFFF; padding-left: 0.9rem; position: relative; }
.mg-footer .widget-title::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 6px; height: 6px; background: var(--mg-copper); }
.mg-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.mg-footer .widget li { padding: 0.35rem 0; }
.mg-footer .widget a { color: var(--mg-copper-light); }
.mg-footer .widget a:hover { color: #FFFFFF; }
.mg-footer .widget .post-date { color: #9FB0C6; }
.mg-footer__bottom { border-top: 1px solid rgba(216, 210, 202, 0.18); padding: 1.4rem 0; }
.mg-footer__bottom p { margin: 0; font-size: 0.85rem; color: #9FB0C6; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 920px;
    margin-inline: auto;
    padding: 1.2rem 1.6rem;
    background: var(--mg-navy);
    color: #E6EAF0;
    border-top: 2px solid var(--mg-copper);
    box-shadow: 0 10px 30px rgba(27, 42, 65, 0.25);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.cookie-banner .btn { flex: 0 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .mg-header__inner { flex-wrap: wrap; gap: 1rem; }
    .mg-nav-toggle { display: block; }
    .mg-nav { display: none; width: 100%; }
    .mg-nav.is-open { display: block; }
    .mg-nav__list { flex-direction: column; gap: 0; padding: 0.6rem 0 0.4rem; border-top: 1px solid rgba(216, 210, 202, 0.2); }
    .mg-nav__list a { padding: 0.6rem 0; }
    .mg-nav__list .sub-menu { position: static; display: block; border-top: 0; padding: 0 0 0 1rem; min-width: 0; }

    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); row-gap: 3rem; }
    .layout-single .content-area { width: 100%; }
    .mg-cards, .mg-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mg-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shell--narrow { width: min(92%, 1180px); }
}

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .mg-brand__mark { width: 42px; height: 42px; }
    .mg-brand__desc { display: none; }
    .mg-section { padding: 4rem 0; }
    .mg-hero { min-height: 70vh; }
    .mg-hero__content { padding: 4.5rem 0 3.5rem; }
    .mg-cards, .layout-with-sidebar .mg-cards, .mg-topics { grid-template-columns: minmax(0, 1fr); }
    .mg-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; padding: 3.2rem 0 2.4rem; }
    .mg-quote { padding: 4.5rem 1.2rem; }
    .mg-quote__fig { column-gap: 0.6rem; }
    .mg-quote__mark { font-size: 3.4rem; }
    .mg-steps { padding-left: 1.4rem; }
    .mg-step { grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1rem; padding: 1.6rem 0; }
    .mg-step::before { left: calc(-1.4rem - 3px); top: 2.5rem; }
    .mg-step__num { font-size: 2.4rem; }
    .sidebar { padding: 1.6rem 1.3rem; }
    .comment-respond { padding: 1.6rem 1.3rem; }
    .mg-empty { padding: 1.6rem 1.3rem; }
    .cookie-banner { flex-direction: column; align-items: flex-start; padding: 1.1rem 1.3rem; gap: 0.9rem; }
    .mg-search { flex-direction: column; }
    .mg-post-nav { grid-template-columns: minmax(0, 1fr); }
    .mg-post-nav__item--next { text-align: start; }
}
