/*
Theme Name: Doggie Magazine
Theme URI: https://blog.doggieeducation.online/
Author: Doggie
Description: Magazine editoriale premium e multilingua per Doggie Education.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: doggie-magazine
*/

:root {
    --dm-ink: #10192b;
    --dm-ink-soft: #5c6677;
    --dm-navy: #101a31;
    --dm-gold: #f5b900;
    --dm-gold-soft: #fff4c7;
    --dm-surface: #ffffff;
    --dm-surface-soft: #f5f7fb;
    --dm-line: rgba(16, 25, 43, 0.1);
    --dm-green: #16845e;
    --dm-radius: 1.6rem;
    --dm-shadow: 0 24px 70px rgba(15, 24, 42, 0.11);
    --dm-max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--dm-surface-soft);
    color: var(--dm-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
}
body.dm-nav-open { overflow: hidden; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; }
.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: 10000;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    padding: .75rem 1rem;
    clip: auto;
    border-radius: .75rem;
    background: #fff;
}
.dm-shell { width: min(calc(100% - 2rem), var(--dm-max)); margin-inline: auto; }

.dm-header {
    position: sticky;
    z-index: 1000;
    top: 0;
    border-bottom: 1px solid var(--dm-line);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 30px rgba(16, 25, 43, .06);
    backdrop-filter: blur(18px);
}
.dm-header__inner {
    display: grid;
    grid-template-columns: minmax(190px, auto) 1fr auto;
    gap: 1.25rem;
    align-items: center;
    min-height: 86px;
}
.dm-brand {
    display: inline-flex;
    gap: .8rem;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}
.dm-brand__mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid rgba(245, 185, 0, .5);
    border-radius: 1rem;
    background: linear-gradient(145deg, #fff8d8, #ffd95c);
    box-shadow: 0 10px 24px rgba(183, 124, 0, .16);
    font-size: 1.55rem;
}
.dm-brand__logo {
    display: block;
    width: auto;
    height: 50px;
    max-width: 136px;
    object-fit: contain;
}
.dm-brand__copy { display: grid; min-width: 0; line-height: 1.08; }
.dm-brand__copy strong { font-size: 1.02rem; font-weight: 900; letter-spacing: -.02em; }
.dm-brand__copy small { margin-top: .3rem; color: var(--dm-ink-soft); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.dm-nav { justify-self: center; }
.dm-nav__list { display: flex; gap: clamp(.75rem, 2vw, 1.7rem); align-items: center; padding: 0; margin: 0; list-style: none; }
.dm-nav a {
    position: relative;
    display: inline-flex;
    padding: .65rem .1rem;
    color: #4b5565;
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
}
.dm-nav a::after {
    position: absolute;
    right: 0;
    bottom: .22rem;
    left: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--dm-gold);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}
.dm-nav a:hover::after, .dm-nav a:focus-visible::after { transform: scaleX(1); }
.dm-header__actions { display: flex; gap: .65rem; align-items: center; }
.dm-language { position: relative; }
.dm-language select {
    min-height: 44px;
    padding: .55rem 2.2rem .55rem .85rem;
    border: 1px solid var(--dm-line);
    border-radius: 999px;
    background: #fff;
    color: var(--dm-ink);
    font-size: .82rem;
    font-weight: 800;
}
.dm-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    padding: .72rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--dm-gold);
    color: var(--dm-ink);
    font-size: .86rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(183, 124, 0, .16);
    transition: transform .2s ease, box-shadow .2s ease;
}
.dm-btn:hover, .dm-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 15px 32px rgba(183, 124, 0, .23); }
.dm-btn--dark { background: var(--dm-navy); color: #fff; box-shadow: none; }
.dm-btn--quiet { border-color: var(--dm-line); background: #fff; box-shadow: none; }
.dm-nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border: 1px solid var(--dm-line);
    border-radius: 50%;
    background: #fff;
    color: var(--dm-ink);
    font-weight: 900;
}

.dm-main { min-height: 60vh; }
.dm-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(4.5rem, 9vw, 8rem) 0 clamp(3.5rem, 8vw, 6.5rem);
    background:
        radial-gradient(circle at 88% 12%, rgba(245, 185, 0, .32), transparent 29%),
        radial-gradient(circle at 12% 88%, rgba(74, 141, 123, .18), transparent 30%),
        linear-gradient(145deg, #fffef8 0%, #f3f6fb 68%, #eef2f8 100%);
}
.dm-hero::after {
    position: absolute;
    top: -6rem;
    right: -4rem;
    width: 20rem;
    height: 20rem;
    border: 3rem solid rgba(255, 255, 255, .42);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}
.dm-hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.dm-eyebrow { display: inline-flex; align-items: center; width: fit-content; padding: .48rem .8rem; border: 1px solid rgba(183, 124, 0, .2); border-radius: 999px; background: rgba(255, 248, 216, .82); color: #8f5b00; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.dm-hero h1 { max-width: 760px; margin: 1.25rem 0 1rem; font-size: clamp(2.75rem, 7vw, 5.7rem); font-weight: 950; letter-spacing: -.065em; line-height: .96; text-wrap: balance; }
.dm-hero__lead { max-width: 690px; margin: 0; color: var(--dm-ink-soft); font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.65; }
.dm-hero__panel { padding: 1.5rem; border: 1px solid rgba(255, 255, 255, .72); border-radius: var(--dm-radius); background: rgba(255, 255, 255, .76); box-shadow: var(--dm-shadow); backdrop-filter: blur(16px); }
.dm-hero__panel strong { display: block; margin-bottom: .35rem; font-size: 1.12rem; }
.dm-hero__panel p { margin: 0 0 1.15rem; color: var(--dm-ink-soft); font-size: .91rem; }

.dm-section { padding: clamp(3.2rem, 7vw, 6rem) 0; }
.dm-section--white { background: #fff; }
.dm-section__head { display: flex; gap: 1.5rem; justify-content: space-between; align-items: end; margin-bottom: 2rem; }
.dm-section__head h2 { margin: .65rem 0 0; font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.05em; line-height: 1.04; }
.dm-section__head p { max-width: 540px; margin: 0; color: var(--dm-ink-soft); }
.dm-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; }
.dm-post-grid > .code-block, .dm-article > .code-block { display: none !important; }
.dm-card { display: flex; min-width: 0; height: 100%; flex-direction: column; overflow: hidden; border: 1px solid var(--dm-line); border-radius: var(--dm-radius); background: #fff; box-shadow: 0 18px 48px rgba(16, 25, 43, .07); transition: transform .25s ease, box-shadow .25s ease; }
.dm-card:hover { transform: translateY(-6px); box-shadow: var(--dm-shadow); }
.dm-card__media { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #f8d96d, #f5f7fb 55%, #cbd8e8); }
.dm-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.dm-card:hover .dm-card__media img { transform: scale(1.035); }
.dm-card__placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: rgba(16, 25, 43, .45); font-size: 3rem; }
.dm-card__body { display: flex; flex: 1; flex-direction: column; padding: 1.35rem; }
.dm-card__meta { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; color: #8f5b00; font-size: .72rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.dm-card h2, .dm-card h3 { margin: .8rem 0 .65rem; font-size: clamp(1.25rem, 2vw, 1.55rem); letter-spacing: -.035em; line-height: 1.17; text-wrap: balance; }
.dm-card h2 a, .dm-card h3 a { text-decoration: none; }
.dm-card p { margin: 0 0 1.25rem; color: var(--dm-ink-soft); font-size: .91rem; line-height: 1.58; }
.dm-card__link { margin-top: auto; color: #775000; font-size: .84rem; font-weight: 900; text-decoration: none; }
.dm-card__link::after { content: " →"; }
.dm-empty { grid-column: 1 / -1; padding: 3rem; border: 1px dashed rgba(16, 25, 43, .18); border-radius: var(--dm-radius); background: #fff; text-align: center; }
.dm-pagination { margin-top: 2.5rem; }
.dm-pagination .nav-links { display: flex; gap: .55rem; justify-content: center; flex-wrap: wrap; }
.dm-pagination a, .dm-pagination span { display: grid; min-width: 44px; min-height: 44px; place-items: center; padding: .5rem .75rem; border: 1px solid var(--dm-line); border-radius: .85rem; background: #fff; text-decoration: none; }
.dm-pagination .current { border-color: var(--dm-gold); background: var(--dm-gold-soft); font-weight: 900; }

.dm-discovery { padding-top: 1rem; }
.dm-discovery__panel {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 2.6rem);
    border: 1px solid rgba(16, 25, 43, .08);
    border-radius: 2rem;
    background: linear-gradient(135deg, #fffdf4 0%, #fff 48%, #f5f8fc 100%);
    box-shadow: 0 22px 60px rgba(16, 25, 43, .08);
}
.dm-discovery__panel::after {
    position: absolute;
    z-index: 0;
    right: -5rem;
    bottom: -7rem;
    width: 17rem;
    height: 17rem;
    border: 2.6rem solid rgba(245, 185, 0, .08);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}
.dm-discovery__head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: end;
}
.dm-discovery__intro h2 { margin: .8rem 0 .55rem; font-size: clamp(1.75rem, 3vw, 2.65rem); letter-spacing: -.045em; line-height: 1.08; }
.dm-discovery__intro p { max-width: 620px; margin: 0; color: var(--dm-ink-soft); font-size: .92rem; }
.dm-discovery__search { min-width: 0; }
.dm-discovery__search > strong { display: block; margin-bottom: .6rem; color: var(--dm-ink); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.dm-categories {
    position: relative;
    z-index: 1;
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    padding: 1.5rem 0 0;
    margin: 1.6rem 0 0;
    border-top: 1px solid var(--dm-line);
    list-style: none;
}
.dm-categories li { display: block; padding: 0; margin: 0; list-style: none; }
.dm-categories li::marker { content: ""; }
.dm-categories a { display: inline-flex; align-items: center; min-height: 42px; padding: .58rem .95rem; border: 1px solid var(--dm-line); border-radius: 999px; background: #fff; color: #3f4b5e; font-size: .8rem; font-weight: 850; line-height: 1.2; text-decoration: none; box-shadow: 0 6px 18px rgba(16, 25, 43, .04); transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease; }
.dm-categories a:hover, .dm-categories a:focus-visible { border-color: rgba(183, 124, 0, .4); background: var(--dm-gold-soft); color: #6f4a00; transform: translateY(-2px); }
.dm-search { display: flex; gap: .55rem; }
.dm-search input[type="search"] { width: 100%; min-width: 0; min-height: 48px; padding: .72rem 1rem; border: 1px solid var(--dm-line); border-radius: 999px; background: #fff; color: var(--dm-ink); outline: none; box-shadow: inset 0 1px 2px rgba(16, 25, 43, .03); }
.dm-search input[type="search"]:focus { border-color: rgba(183, 124, 0, .55); box-shadow: 0 0 0 4px rgba(245, 185, 0, .14); }

.dm-article-hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 2.5rem; background: linear-gradient(145deg, #fffef8, #f3f6fb); }
.dm-article-hero__inner { max-width: 920px; margin-inline: auto; }
.dm-article-hero h1 { margin: 1.1rem 0; font-size: clamp(2.35rem, 6vw, 4.8rem); letter-spacing: -.055em; line-height: 1.01; text-wrap: balance; }
.dm-article-meta { display: flex; gap: .75rem 1.2rem; flex-wrap: wrap; color: var(--dm-ink-soft); font-size: .86rem; }
.dm-original-note { margin-top: 1.2rem; padding: .85rem 1rem; border-left: 4px solid var(--dm-gold); border-radius: .35rem 1rem 1rem .35rem; background: var(--dm-gold-soft); color: #6d4b00; font-size: .84rem; }
.dm-article-cover { width: min(calc(100% - 2rem), 1080px); max-height: 620px; margin: 0 auto; overflow: hidden; border-radius: 2rem; box-shadow: var(--dm-shadow); }
.dm-article-cover img { width: 100%; height: min(58vw, 620px); object-fit: cover; }
.dm-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: clamp(2.25rem, 4vw, 3.75rem); align-items: start; padding: clamp(2.4rem, 5vw, 4.25rem) 0; }
.dm-article { min-width: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.03rem, 1.3vw, 1.14rem); line-height: 1.7; }
.dm-article > *:first-child { margin-top: 0; }
.dm-article p { margin: 0 0 1.12em; }
.dm-article h2, .dm-article h3 { margin: 1.75em 0 .62em; color: var(--dm-ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.035em; line-height: 1.15; }
.dm-article ul, .dm-article ol { margin: 0 0 1.25em; }
.dm-article a { color: #7d5700; text-decoration-thickness: .1em; text-underline-offset: .16em; }
.dm-article blockquote { margin: 2rem 0; padding: 1.4rem 1.5rem; border-left: 5px solid var(--dm-gold); border-radius: .5rem 1.25rem 1.25rem .5rem; background: #fff9df; color: #3d4656; font-size: 1.08em; }
.dm-article-sources { margin-top: 3rem; padding: 1.5rem; border: 1px solid var(--dm-line); border-radius: 1.35rem; background: #fff; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.dm-article-sources h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.dm-article-sources ol { display: grid; gap: .65rem; margin: 0; padding-left: 1.4rem; }
.dm-article-sources li { color: var(--dm-ink-soft); font-size: .84rem; overflow-wrap: anywhere; }
.dm-article-sidebar { position: sticky; top: 110px; display: grid; gap: 1rem; }
.dm-sidebar-card { padding: 1.35rem; border: 1px solid var(--dm-line); border-radius: 1.35rem; background: #fff; box-shadow: 0 14px 38px rgba(16, 25, 43, .07); }
.dm-sidebar-card h2 { margin: 0 0 .65rem; font-size: 1.08rem; }
.dm-sidebar-card p { margin: 0 0 1rem; color: var(--dm-ink-soft); font-size: .84rem; line-height: 1.55; }
.dm-sidebar-card .dm-btn { width: 100%; }

.dm-newsletter { padding: clamp(2rem, 5vw, 3.5rem); border-radius: 2rem; background: var(--dm-navy); color: #fff; box-shadow: var(--dm-shadow); }
.dm-newsletter h2 { margin: .65rem 0 .75rem; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; }
.dm-newsletter p { max-width: 720px; margin: 0 0 1.35rem; color: #c9d2e0; }
.dm-footer { padding: 3.5rem 0 1.5rem; background: #0d1628; color: #fff; }
.dm-footer__grid { display: grid; grid-template-columns: 1.2fr repeat(2, .8fr); gap: 2.5rem; }
.dm-footer h2 { margin: 0 0 .7rem; font-size: 1.2rem; }
.dm-footer p { max-width: 450px; margin: 0; color: #b7c1d0; font-size: .87rem; }
.dm-footer h3 { margin: 0 0 .8rem; color: #f9d862; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.dm-footer ul { display: grid; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.dm-footer a { color: #d9e0ea; font-size: .86rem; text-decoration: none; }
.dm-footer a:hover { color: #fff; }
.dm-footer__bottom { display: flex; gap: .75rem 1.5rem; justify-content: space-between; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .11); color: #aeb8c8; font-size: .75rem; }

@media (max-width: 1080px) {
    .dm-header__inner { grid-template-columns: 1fr auto; }
    .dm-nav-toggle { display: inline-grid; place-items: center; }
    .dm-nav { position: fixed; z-index: 1001; inset: 86px 0 0; display: none; padding: 1.25rem; background: rgba(245, 247, 251, .98); overflow-y: auto; }
    .dm-nav.is-open { display: block; }
    .dm-nav__list { display: grid; gap: .45rem; }
    .dm-nav a { width: 100%; padding: 1rem; border: 1px solid var(--dm-line); border-radius: 1rem; background: #fff; }
    .dm-nav a::after { display: none; }
    .dm-header__actions .dm-btn { display: none; }
    .dm-hero__grid { grid-template-columns: 1fr; }
    .dm-hero__panel { max-width: 620px; }
    .dm-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dm-article-layout { grid-template-columns: 1fr; }
    .dm-article-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dm-discovery__head { grid-template-columns: 1fr; }
    .dm-discovery__search { max-width: 620px; }
}

@media (max-width: 680px) {
    body { font-size: 16px; }
    .dm-shell { width: min(calc(100% - 1.25rem), var(--dm-max)); }
    .dm-header__inner { grid-template-columns: minmax(0, 1fr) auto; min-height: 74px; gap: .45rem; }
    .dm-nav { inset-block-start: 74px; }
    .dm-brand__mark { width: 42px; height: 42px; flex-basis: 42px; }
    .dm-brand { gap: .5rem; overflow: hidden; }
    .dm-brand__logo { width: auto; height: 40px; max-width: 88px; flex: 0 1 88px; }
    .dm-brand__copy strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
    .dm-brand__copy small { display: none; }
    .dm-header__actions { gap: .4rem; }
    .dm-language select { width: 54px; min-height: 42px; padding-inline: .55rem; color: transparent; text-shadow: 0 0 0 var(--dm-ink); }
    .dm-nav-toggle { width: 42px; height: 42px; flex: 0 0 42px; }
    .dm-hero { padding-top: 3.4rem; }
    .dm-hero__grid, .dm-hero__grid > *, .dm-section__head > * { min-width: 0; }
    .dm-hero__panel { width: 100%; }
    .dm-hero h1 { max-width: 100%; font-size: clamp(2.45rem, 12vw, 3.05rem); overflow-wrap: anywhere; }
    .dm-hero__lead, .dm-hero__panel p { overflow-wrap: anywhere; }
    .dm-section__head { display: grid; }
    .dm-post-grid { grid-template-columns: 1fr; }
    .dm-article-sidebar { grid-template-columns: 1fr; }
    .dm-footer__grid { grid-template-columns: 1fr; }
    .dm-btn { white-space: normal; }
    .dm-discovery { padding-top: .5rem; }
    .dm-discovery__panel { padding: 1.2rem; border-radius: 1.5rem; }
    .dm-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .dm-search .dm-btn { min-width: 86px; padding-inline: .85rem; }
    .dm-categories { gap: .5rem; padding-top: 1.1rem; margin-top: 1.25rem; }
}

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