/*
Theme Name: MG Editorial
Theme URI: https://marcogiorgini.me
Author: MG Site Project
Description: Tema editoriale chiaro per Games, Books, KURT Comics e Blog.
Version: 1.0.6
Requires PHP: 7.4
Text Domain: mg-editorial
*/
:root{--ink:#18253c;--blue:#1656a4;--orange:#df5c20;--paper:#fffaf3;--line:#e7dacb;--muted:#697286;--white:#fffefb}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.62 system-ui,-apple-system,'Segoe UI',sans-serif}a{color:var(--blue);text-decoration:none}a:hover{text-decoration:underline}img{max-width:100%;height:auto}button,input,select{font:inherit}.mg-wrap{max-width:1180px;margin:0 auto;padding:0 24px}.mg-header{background:var(--white);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}.mg-header-inner{min-height:86px;display:flex;align-items:center;justify-content:space-between;gap:22px}.mg-brand{color:var(--ink);font:800 29px Georgia,serif;white-space:nowrap}.mg-brand small{display:block;font:700 10px system-ui;letter-spacing:2px;color:var(--muted)}.mg-header nav{display:flex;flex-wrap:wrap;gap:3px}.mg-header nav a{padding:9px 12px;border-radius:7px;color:var(--ink);font-size:14px;font-weight:700}.mg-header nav a:hover{background:#f8e7d8;text-decoration:none}h1,h2,h3{font-family:Georgia,'Times New Roman',serif;line-height:1.16}h1{font-size:clamp(40px,5vw,64px);letter-spacing:-1.5px}h2{font-size:clamp(27px,3vw,36px)}h3{font-size:22px}p{margin:0 0 16px}.mg-eyebrow,.mg-kicker{font:800 12px system-ui;letter-spacing:1.8px;text-transform:uppercase;color:var(--orange)}.mg-muted{color:var(--muted);font-size:14px}.mg-hero{padding:88px 0 85px;display:grid;grid-template-columns:1.45fr 1fr;gap:32px;align-items:center;border-bottom:1px solid var(--line)}.mg-hero h1{margin:15px 0 24px}.mg-hero h1 em{font-style:normal;color:var(--orange)}.mg-hero p:not(.mg-eyebrow){max-width:550px;font-size:19px}.mg-hero-pixel{height:260px;background:#e5effb;border:8px solid #c9d8e8;border-radius:16px;display:flex;align-items:center;justify-content:center;gap:20px;color:var(--blue);font-size:65px;box-shadow:18px 18px 0 #f9dfca}.mg-hero-pixel span:nth-child(2){font-size:115px;color:var(--orange)}.mg-button,.mg-filters button{display:inline-block;border:0;background:var(--orange);color:white;padding:12px 19px;border-radius:7px;font-weight:750;cursor:pointer}.mg-button:hover,.mg-filters button:hover{background:#bd4715;text-decoration:none;color:#fff}.mg-button-outline{background:var(--blue)}.mg-section{padding:57px 0 18px}.mg-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:24px;border-bottom:1px solid var(--line)}.mg-section-head h2{margin:0 0 18px}.mg-section-head>a{font-weight:750}.mg-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}.mg-card{background:var(--white);border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:0 6px 20px #18253c08}.mg-card-media{display:flex;height:215px;align-items:center;justify-content:center;background:#f2e9de;overflow:hidden}.mg-card-media img{width:100%;height:100%;object-fit:contain}.mg-card-book .mg-card-media{height:290px}.mg-card-book .mg-card-media img{padding:12px}.mg-card-body{padding:18px 20px 22px}.mg-card-body h3{margin:0 0 10px}.mg-card-body h3 a{color:var(--ink)}.mg-card-body p{font-size:14px;color:var(--muted)}.mg-placeholder{font-size:62px;color:var(--blue)}.mg-comics-callout{background:#f3e8da;border-radius:18px;padding:36px;margin-top:60px;display:flex;align-items:center;justify-content:space-between;gap:20px}.mg-comics-deco{font:900 70px Georgia,serif;color:var(--orange);transform:rotate(-8deg)}.mg-page-head{padding:65px 0 28px;border-bottom:1px solid var(--line)}.mg-page-head h1{margin:8px 0 12px}.mg-filters{display:flex;flex-wrap:wrap;gap:12px;padding:26px 0}.mg-filters input,.mg-filters select{border:1px solid #d5c8bb;background:#fff;border-radius:7px;padding:10px;min-width:140px}.mg-filters input{flex:1;min-width:220px}.mg-reset{align-self:center}.mg-blog-grid{padding:10px 0 35px}.mg-post-card .mg-card-media img{object-fit:cover}.mg-pagination{padding:30px 0 50px}.mg-pagination ul{list-style:none;display:flex;flex-wrap:wrap;gap:8px;padding:0}.mg-pagination a,.mg-pagination span{display:inline-block;padding:7px 12px;border:1px solid var(--line);border-radius:6px}.mg-pagination .current{background:var(--blue);color:#fff}.mg-detail,.mg-article,.mg-strip-reader{padding:55px 0 75px}.mg-detail-grid{display:grid;grid-template-columns:minmax(260px,0.9fr) 1.1fr;gap:50px;align-items:start;margin-top:22px}.mg-detail h1,.mg-article h1,.mg-strip-reader h1{margin:8px 0 20px}.mg-detail-image{min-height:250px;background:#f1e9dd;border-radius:14px;display:flex;align-items:flex-start;justify-content:center;padding:25px}.mg-detail-image img{max-height:520px;object-fit:contain}.mg-detail-meta{color:var(--muted);margin:20px 0}.mg-richtext{line-height:1.8;overflow-wrap:anywhere;display:flow-root}.mg-richtext img{max-width:100%;height:auto}.mg-richtext .alignleft{float:left;margin:7px 24px 15px 0}.mg-richtext .alignright{float:right;margin:7px 0 15px 24px}.mg-richtext .aligncenter{display:block;margin:22px auto}.mg-richtext figure{max-width:100%}.mg-richtext figure.aligncenter{margin-left:auto;margin-right:auto}.mg-richtext iframe{max-width:100%}.mg-article{max-width:860px;margin:auto}.mg-article h1{font-size:clamp(36px,4vw,54px)}.mg-article .mg-richtext{margin-top:35px}.mg-article .mg-richtext p{margin-bottom:1.3em}.mg-edit{display:inline-block;border:1px solid #e1bb9f;padding:5px 10px;border-radius:5px;color:#a34c19;font-size:13px}.mg-taxonomy{padding:25px 0;border-top:1px solid var(--line);margin-top:30px}.mg-prevnext{display:flex;justify-content:space-between;gap:25px;margin-top:30px;padding-top:20px;border-top:1px solid var(--line)}.mg-strip-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding-top:32px}.mg-strip-grid .mg-card-media{height:auto;min-height:120px;padding:12px}.mg-strip-grid .mg-card-media img{width:100%;height:auto;max-height:none;object-fit:contain}.mg-strip-reader{text-align:center}.mg-strip-image{max-width:640px;margin:25px auto}.mg-strip-image img{width:100%;height:auto;display:block}.mg-strip-reader .mg-richtext{max-width:760px;margin:15px auto}.mg-comic-text img{max-width:640px;height:auto}.mg-footer{margin-top:80px;background:#fff;border-top:1px solid var(--line);padding:28px 0;color:var(--muted);font-size:13px}.mg-footer .mg-wrap{display:flex;justify-content:space-between;gap:15px}.screen-reader-text{position:absolute;clip:rect(1px,1px,1px,1px);height:1px;width:1px;overflow:hidden}@media(max-width:850px){.mg-header-inner{align-items:flex-start;flex-direction:column;padding-top:15px;padding-bottom:14px}.mg-hero{grid-template-columns:1fr;padding:55px 0}.mg-hero-pixel{height:150px}.mg-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mg-detail-grid{grid-template-columns:1fr}.mg-comics-deco{font-size:45px}}@media(max-width:560px){.mg-wrap{padding:0 16px}.mg-header{position:static}.mg-header nav a{padding:7px 8px;font-size:13px}.mg-grid,.mg-strip-grid{grid-template-columns:1fr}.mg-hero-pixel{display:none}.mg-comics-deco{display:none}.mg-section{padding-top:40px}.mg-page-head{padding-top:35px}.mg-richtext .alignleft,.mg-richtext .alignright{float:none;display:block;margin:15px auto}.mg-footer .mg-wrap{flex-direction:column}}

/* Archivio fumetti: anteprime larghe e basse, senza contenitori quadrati. */
.mg-strip-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.mg-comic-tile{min-width:0;text-align:center}
.mg-comic-tile-image{display:block;background:#f6efe6;border:1px solid var(--line);border-radius:10px;padding:8px;line-height:0}
.mg-comic-tile-image img{display:block;width:100%;height:auto;object-fit:contain}
.mg-comic-tile-caption{margin-top:8px;font-size:13px}
@media(max-width:850px){.mg-strip-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.mg-strip-grid{grid-template-columns:1fr}}

/* MG Editorial 0.3 — homepage, blog navigation, KURT reader */
.mg-hero-feature{display:block;overflow:hidden;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:15px 15px 0 #f9dfca;color:var(--ink)}
.mg-hero-feature:hover{text-decoration:none}
.mg-hero-feature-image{height:250px;display:flex;align-items:center;justify-content:center;background:#f4eee5;overflow:hidden}
.mg-hero-feature-image img{width:100%;height:100%;object-fit:contain}
.mg-hero-feature-caption{padding:14px 18px 18px;display:flex;flex-direction:column;gap:3px}
.mg-hero-feature-caption span{font-size:11px;letter-spacing:1.5px;font-weight:800;color:var(--orange)}
.mg-hero-feature-caption strong{font-family:Georgia,serif;font-size:20px;line-height:1.25}
.mg-blog-pages{display:flex!important;flex-flow:row wrap!important;align-items:center;justify-content:flex-start;gap:9px;padding:20px 0 40px;list-style:none}
.mg-blog-pages a,.mg-blog-pages span{display:inline-flex;align-items:center;justify-content:center;min-width:42px;min-height:40px;padding:7px 12px;margin:0;border:1px solid var(--line);border-radius:7px;background:#fff;line-height:1.2}
.mg-blog-pages a[aria-current="page"]{background:var(--blue);color:#fff;border-color:var(--blue)}
.mg-blog-pages .mg-page-ellipsis{border:0;background:transparent;min-width:24px}
.mg-kurt-reader{text-align:center;padding:55px 0 20px}
.mg-kurt-reader h1{margin:8px 0 14px}
.mg-kurt-controls{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;margin:20px auto 25px}
.mg-kurt-button{display:inline-block;padding:10px 15px;border:1px solid #d5c8bb;border-radius:7px;background:#fff;color:var(--ink)}
.mg-kurt-disabled{opacity:.35;cursor:default}
.mg-kurt-full-image{max-width:640px;margin:0 auto}
.mg-kurt-full-image img{display:block;width:100%;height:auto;object-fit:contain}
.mg-kurt-original{margin:18px auto}
.mg-kurt-jump{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap}
.mg-kurt-jump input{width:75px;padding:6px;border:1px solid var(--line);border-radius:5px}
.mg-kurt-jump button{border:1px solid var(--line);background:#fff;border-radius:5px;padding:6px 10px;cursor:pointer}
.mg-kurt-archive{padding:18px 0 55px}
.mg-kurt-archive h2{text-align:center;margin:22px 0 25px}
.mg-kurt-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.mg-kurt-tile{min-width:0;border:1px solid var(--line);border-radius:13px;overflow:hidden;background:#fff}
.mg-kurt-tile>a{display:block;color:var(--ink);text-decoration:none;padding:10px}
.mg-kurt-thumb{background:#f4eee7;border:1px solid var(--line);line-height:0}
.mg-kurt-thumb img{display:block;width:100%;height:auto;object-fit:contain}
.mg-kurt-tile p{font-size:14px;margin:10px 4px 3px}
.mg-kurt-tile p span{color:var(--muted);font-size:12px}
.mg-kurt-pages{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:26px}
.mg-kurt-pages a,.mg-kurt-pages span{padding:7px 12px;border:1px solid var(--line);border-radius:6px}
.mg-kurt-pages a[aria-current="page"]{background:var(--blue);color:#fff}
.mg-kurt-back{text-align:center}
@media(max-width:600px){.mg-kurt-tiles{grid-template-columns:1fr}.mg-hero-feature-image{height:190px}}

/* v0.4: lettrice KURT e archivio nella stessa pagina */
.mg-kurt-reader{max-width:850px;margin:0 auto;text-align:center;padding:54px 0 22px}
.mg-kurt-reader h1{margin:8px 0 12px}
.mg-kurt-controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:14px;margin:24px 0}
.mg-kurt-button{display:inline-block;padding:10px 16px;border:1px solid #d9cabc;border-radius:7px;background:#fff;color:var(--ink)}
.mg-kurt-disabled{opacity:.35;pointer-events:none}
.mg-kurt-full-image{max-width:640px;margin:20px auto}
.mg-kurt-full-image img{display:block;width:100%;height:auto;max-width:640px;margin:auto}
.mg-kurt-jump{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap;margin:20px auto}
.mg-kurt-jump input{width:76px;border:1px solid var(--line);padding:8px;border-radius:5px}
.mg-kurt-jump button{padding:8px 12px;background:#fff;border:1px solid var(--line);border-radius:5px;cursor:pointer}
.mg-kurt-archive{max-width:900px;margin:30px auto 70px}
.mg-kurt-archive h2{text-align:center}
.mg-kurt-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.mg-kurt-tile{border:1px solid var(--line);border-radius:12px;padding:10px;background:#fffefb;min-width:0}
.mg-kurt-tile a{display:block;color:var(--ink)}
.mg-kurt-thumb{background:#f6efe6;border:1px solid var(--line);padding:6px;line-height:0}
.mg-kurt-thumb img{display:block;width:100%;height:auto}
.mg-kurt-tile p{font-size:13px;margin:10px 4px 2px}
.mg-kurt-tile p span{color:var(--muted)}
.mg-kurt-pages{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin:25px auto}
.mg-kurt-pages a,.mg-kurt-pages span{padding:6px 12px;border:1px solid var(--line);border-radius:6px}
.mg-kurt-pages a[aria-current=page]{background:var(--blue);color:#fff}
@media(max-width:600px){.mg-kurt-tiles{grid-template-columns:1fr}}

/* KURT: no animated anchor scroll after a strip navigation. */
html:has(.mg-kurt-reader){scroll-behavior:auto}

/* v0.6 — navigation state, hero actions, blog priority */
.mg-header nav a.mg-nav-active,
.mg-header nav a.mg-nav-active:hover{background:var(--orange);color:#fff;text-decoration:none}
.mg-hero-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:23px}
.mg-button-outline-light{background:transparent;color:var(--blue);border:1px solid var(--blue)}
.mg-button-outline-light:hover{background:var(--blue);color:#fff}
.mg-hero-actions .mg-button{white-space:nowrap}
@media(max-width:560px){.mg-hero-actions{align-items:stretch}.mg-hero-actions .mg-button{text-align:center}}

/* v0.7 — explicit single active navigation item, hover and robust pagination */
.mg-header nav a.mg-nav-active,
.mg-header nav a.mg-nav-active:hover,
.mg-header nav a:hover,
.mg-header nav a:focus-visible{background:var(--orange);color:#fff;text-decoration:none}
.mg-pagination,.mg-blog-pages,.mg-archive-pages{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:28px 0 54px;clear:both}
.mg-pagination a,.mg-pagination span{display:inline-flex;align-items:center;justify-content:center;min-width:38px;padding:8px 12px;border:1px solid var(--line);border-radius:6px;background:var(--white);color:var(--ink);line-height:1.3}
.mg-pagination a[aria-current="page"],.mg-pagination .current{background:var(--blue);color:#fff;border-color:var(--blue)}
.mg-pagination a:hover{background:#f8e7d8;text-decoration:none}
.mg-pagination .mg-page-ellipsis{border:0;background:transparent;min-width:18px}

/* v0.9 — KURT image in home */
.mg-comics-art{flex:0 1 310px;min-width:0;display:flex;justify-content:center;align-items:center}
.mg-comics-art img{display:block;max-width:100%;max-height:225px;width:auto;height:auto;object-fit:contain;border-radius:10px}
@media(max-width:560px){.mg-comics-art{flex-basis:100%;margin-top:8px}.mg-comics-art img{max-height:180px}}

/* v1.0 — archivio gerarchico e link istituzionali */
.mg-archive-group{margin:34px 0 42px;border:1px solid var(--line);border-radius:14px;padding:22px 28px;background:#fffdf9}
.mg-archive-group h2{margin:0 0 18px}
.mg-archive-tree{margin:0;padding-left:20px;list-style:disc}
.mg-archive-tree li{padding:5px 0}
.mg-archive-tree ul{margin-top:4px;padding-left:22px;list-style:circle}
.mg-archive-parent{color:var(--muted);font-weight:600}
.mg-footer nav{display:flex;gap:18px;flex-wrap:wrap}
@media(max-width:600px){.mg-archive-group{padding:18px}.mg-archive-tree ul{padding-left:16px}}

/* v1.0.4 — immagini schede con rapporto fisso e opzione per singolo progetto */
.mg-detail-image{width:100%;min-height:0;aspect-ratio:4 / 3;padding:0;overflow:hidden;display:flex;align-items:center;justify-content:center}
.mg-detail-image.mg-detail-book{aspect-ratio:3 / 4}
.mg-detail-image img{display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;object-position:center}
.mg-detail-image.mg-fit-contain{padding:16px}
.mg-detail-image.mg-fit-contain img{object-fit:contain}
@media(max-width:700px){.mg-detail-image{max-height:460px}}

/* v1.0.5: CTA sempre immediatamente sotto la copertina, non dopo la descrizione */
.mg-detail-media{min-width:0}
.mg-detail-action{margin:16px 0 0}
.mg-detail-action .mg-button{max-width:100%;text-align:center}
