/*
Theme Name: Michele Scalini Cinematico
Theme URI: https://michelescalini.it
Author: Michele Scalini
Description: Restyling cinematografico scuro del sito ufficiale di Michele Scalini. Basato sul tema Michele Scalini Editoriale e compatibile con i contenuti WordPress esistenti.
Version: 2.0.5
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: michele-scalini-cinematico
*/

:root {
  --ms-bg: #061019;
  --ms-bg-deep: #030a11;
  --ms-panel: #09141e;
  --ms-panel-soft: #0b1722;
  --ms-text: #f4f2ed;
  --ms-muted: #a8b0b8;
  --ms-blue: #7d9fb5;
  --ms-gold: #e7b75f;
  --ms-gold-soft: #f3cb7e;
  --ms-line: rgba(186, 207, 220, .17);
  --ms-shadow: 0 28px 90px rgba(0,0,0,.34);
  --ms-shell: 1460px;
  --ms-reading: 820px;
  --ms-display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --ms-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ms-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ms-bg-deep); }
body { margin: 0; color: var(--ms-text); background: linear-gradient(180deg,#061019 0%,#030a11 100%); font-family: var(--ms-sans); -webkit-font-smoothing: antialiased; }
body.ms-menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ms-shell { width: min(var(--ms-shell), calc(100% - 88px)); margin-inline: auto; }
.ms-narrow { width: min(var(--ms-reading), calc(100% - 48px)); margin-inline: auto; }
.ms-section { padding-block: 96px; }
.ms-eyebrow { margin: 0; color: #c6d4de; font: 800 .72rem/1.3 var(--ms-sans); letter-spacing: .32em; text-transform: uppercase; }

/* Header */
.ms-header { position: sticky; z-index: 1000; top: 0; border-bottom: 1px solid var(--ms-line); background: rgba(3,10,17,.92); backdrop-filter: blur(18px); }
.admin-bar .ms-header { top: 32px; }
.ms-header-inner { min-height: 76px; display: grid; grid-template-columns: 1fr auto auto; gap: 42px; align-items: center; }
.ms-brand { display: inline-flex; align-items: center; min-width: 0; }
.ms-brand-copy { display: grid; gap: 5px; }
.ms-brand-copy strong { font: 500 1.48rem/1 var(--ms-sans); letter-spacing: .18em; white-space: nowrap; }
.ms-brand-copy small { color: #91a5b2; font: 700 .62rem/1 var(--ms-sans); letter-spacing: .34em; white-space: nowrap; }
.ms-nav { display: flex; align-items: center; gap: 34px; }
.ms-nav a { position: relative; padding: 29px 0 27px; color: #eef0f1; font-size: .82rem; font-weight: 650; }
.ms-nav a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 17px; height: 2px; background: var(--ms-gold); box-shadow: 0 0 12px rgba(231,183,95,.5); transition: .22s ease; }
.ms-nav a:hover::after, .ms-nav a.is-active::after { left: 0; right: 0; }
.ms-header-cta { min-width: 164px; min-height: 44px; padding: 0 22px; border: 1px solid rgba(213,226,234,.45); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; font-size: .78rem; font-weight: 700; transition: .25s ease; }
.ms-header-cta:hover { border-color: var(--ms-gold); color: var(--ms-gold-soft); transform: translateY(-1px); }
.ms-menu-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--ms-line); background: transparent; color: var(--ms-text); align-items: center; justify-content: center; flex-direction: column; gap: 5px; cursor: pointer; }
.ms-menu-toggle > span:not(.screen-reader-text) { display: block; width: 18px; height: 1px; background: currentColor; }

/* Hero */
.ms-hero { min-height: 610px; position: relative; overflow: hidden; border-bottom: 1px solid var(--ms-line); background: #07111a; }
.ms-hero-backdrop, .ms-hero-vignette { position: absolute; inset: 0; }
.ms-hero-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 56%; filter: saturate(.76) contrast(1.08) brightness(.78); transform: scale(1.015); }
.ms-hero-vignette { background: linear-gradient(90deg,rgba(3,10,17,.98) 0%,rgba(3,10,17,.89) 24%,rgba(3,10,17,.49) 49%,rgba(3,10,17,.06) 76%), linear-gradient(180deg,rgba(2,8,13,.02) 40%,rgba(2,8,13,.58) 100%); }
.ms-hero-grid { position: relative; z-index: 3; min-height: 610px; display: grid; grid-template-columns: minmax(0,760px) 1fr; align-items: center; padding-block: 48px; }
.ms-hero-copy { align-self: center; padding-top: 8px; }
.ms-hero h1 { margin: 18px 0 14px; max-width: 730px; color: #f7f6f1; font: 900 clamp(3.55rem,5.55vw,6rem)/.92 var(--ms-display); letter-spacing: .035em; text-transform: uppercase; text-shadow: 0 8px 40px rgba(0,0,0,.52); }
.ms-lead { max-width: 720px; margin: 0; color: #f0eee8; font-size: clamp(1rem,1.42vw,1.22rem); line-height: 1.48; text-shadow: 0 2px 16px rgba(0,0,0,.68); }
.ms-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.ms-button { min-height: 48px; padding: 0 27px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 15px; font-size: .78rem; font-weight: 800; transition: .22s ease; }
.ms-button-solid { border: 1px solid var(--ms-gold); background: linear-gradient(180deg,var(--ms-gold-soft),var(--ms-gold)); color: #1d1609; box-shadow: 0 10px 34px rgba(214,161,68,.14); }
.ms-button-solid:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 38px rgba(214,161,68,.23); }
.ms-button-ghost { border: 1px solid rgba(235,241,245,.62); background: rgba(3,10,17,.28); color: #fff; }
.ms-button-ghost:hover { border-color: var(--ms-gold); color: var(--ms-gold-soft); transform: translateY(-2px); }
.ms-hero-quote { margin: 26px 0 0; padding: 0; border: 0; color: #c4c3bf; font: italic 1rem/1.45 var(--ms-serif); }
.ms-hero-quote cite { display: block; margin-top: 10px; color: #94a4ae; font: 700 .62rem/1 var(--ms-sans); letter-spacing: .27em; text-transform: uppercase; }
.ms-hero-manifesto { justify-self: end; align-self: start; margin-top: 74px; display: grid; gap: 13px; color: #c5d1d8; font: 800 .72rem/1 var(--ms-sans); letter-spacing: .34em; }

/* Home sections */
.ms-home-section { padding: 34px 0 40px; border-bottom: 1px solid var(--ms-line); background: rgba(3,10,17,.66); }
.ms-latest { background: linear-gradient(180deg,#061019 0%,#05101a 100%); }
.ms-home-heading { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.ms-home-heading h2 { margin: 0; font: 900 1.2rem/1 var(--ms-display); letter-spacing: .08em; text-transform: uppercase; }
.ms-home-heading > a { color: #e9e6df; font-size: .74rem; border-bottom: 1px solid rgba(231,183,95,.5); padding-bottom: 5px; }
.ms-home-heading > a span { margin-left: 9px; }

.ms-featured-books { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 46px; }
.ms-featured-book { min-width: 0; display: grid; grid-template-columns: minmax(128px,42%) 1fr; gap: 23px; align-items: center; }
.ms-featured-cover { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #0c1721; box-shadow: 0 18px 42px rgba(0,0,0,.32); }
.ms-featured-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.ms-featured-book:hover .ms-featured-cover img { transform: scale(1.035); }
.ms-cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.18); font: 900 3rem/1 var(--ms-display); letter-spacing: .08em; background: radial-gradient(circle at 50% 30%,#173048,#0b151f 68%); }
.ms-cover-label { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); max-width: calc(100% - 16px); padding: 5px 9px; background: rgba(225,199,155,.94); color: #111; font: 850 .52rem/1 var(--ms-sans); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.ms-featured-copy h3 { margin: 0 0 13px; font: 800 clamp(1.05rem,1.4vw,1.32rem)/1.1 var(--ms-sans); }
.ms-featured-copy p { margin: 0 0 21px; min-height: 3.6em; color: #c4c8cb; font-size: .8rem; line-height: 1.55; }
.ms-outline-link { min-height: 41px; padding: 0 19px; border: 1px solid var(--ms-gold); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; color: #f0eee9; font-size: .73rem; font-weight: 750; transition: .22s ease; }
.ms-outline-link:hover { background: var(--ms-gold); color: #161006; transform: translateY(-1px); }
.ms-empty-state { color: var(--ms-muted); }

.ms-home-collections { padding-top: 31px; padding-bottom: 29px; background: #050e16; }
.ms-collection-strip { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 13px; }
.ms-collection-tile { min-width: 0; text-align: center; }
.ms-collection-image { display: block; aspect-ratio: 1.7/1; overflow: hidden; border: 1px solid rgba(190,210,222,.13); background: #0c1721; }
.ms-collection-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(1.04) brightness(.78); transition: transform .4s ease, filter .4s ease; }
.ms-collection-tile:hover img { transform: scale(1.055); filter: saturate(.95) brightness(.9); }
.ms-collection-tile strong { display: block; margin-top: 10px; color: #f0eee8; font: 900 .69rem/1.15 var(--ms-display); letter-spacing: .09em; text-transform: uppercase; }
.ms-collection-tile small { display: block; margin: 6px auto 0; max-width: 150px; min-height: 2.5em; color: #adb5bb; font-size: .66rem; line-height: 1.3; }

/* Author */
.ms-author-section { min-height: 390px; display: grid; grid-template-columns: 34% 41% 25%; border-bottom: 1px solid var(--ms-line); background: #061019; }
.ms-author-visual { min-height: 390px; display: grid; place-items: center; background: radial-gradient(circle at 25% 40%,rgba(231,183,95,.28),transparent 25%), linear-gradient(135deg,#263546,#101a23 52%,#060d14); background-position: center 24%; background-size: cover; color: rgba(255,255,255,.19); font: 900 7rem/1 var(--ms-display); letter-spacing: .08em; }
.ms-author-visual.has-image {
  background-size: auto 76%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: inset 0 0 70px rgba(3,10,17,.22);
}
.ms-author-copy { display: flex; flex-direction: column; justify-content: center; padding: 44px 68px; }
.ms-author-copy h2 { margin: 12px 0 14px; font: 900 clamp(1.75rem,2.2vw,2.45rem)/1 var(--ms-display); letter-spacing: .08em; }
.ms-author-copy > p:not(.ms-eyebrow) { max-width: 680px; margin: 0 0 15px; color: #d0d2d2; font-size: .86rem; line-height: 1.58; }
.ms-author-copy .ms-author-intro { color: #e7e5df; font-size: .91rem; }
.ms-author-copy .ms-author-intro strong { font-weight: 720; }
.ms-author-copy .ms-outline-link { align-self: flex-start; }
.ms-author-quote { margin: 0; padding: 48px 58px 40px 24px; align-self: center; color: #86a5b8; font: italic clamp(1.05rem,1.55vw,1.42rem)/1.45 var(--ms-serif); }
.ms-author-quote strong { color: #a7bdca; font-weight: 700; }
.ms-author-quote > span { display: block; height: 30px; color: #7698ad; font: 700 3.2rem/1 var(--ms-serif); }
.ms-author-quote cite { display: block; margin-top: 20px; color: #9fb0bb; font: 700 .62rem/1 var(--ms-sans); letter-spacing: .25em; text-transform: uppercase; }

/* Internal pages */
.ms-content-main { min-height: 66vh; padding-block: 82px 100px; background: radial-gradient(circle at 80% 0%,rgba(35,76,105,.15),transparent 28%), var(--ms-bg-deep); }
.ms-page-hero { margin-bottom: 46px; }
.ms-page-hero > p:last-child { max-width: 650px; color: var(--ms-muted); font-size: 1rem; line-height: 1.7; }
.ms-page-title, .ms-entry-title { margin: 13px 0 24px; color: #f7f5ef; font: 900 clamp(3rem,6vw,5.8rem)/.92 var(--ms-display); letter-spacing: .025em; text-transform: uppercase; }
.ms-entry-content { color: #cfd2d3; font-size: 1.03rem; line-height: 1.82; }
.ms-entry-content h1, .ms-entry-content h2, .ms-entry-content h3, .ms-entry-content h4 { color: #f5f2eb; }
.ms-entry-content h1, .ms-entry-content h2 { font-family: var(--ms-display); letter-spacing: .02em; }
.ms-entry-content h1 { font-size: clamp(2.7rem,5vw,4.7rem); }
.ms-entry-content h2 { margin-top: 1.6em; font-size: clamp(2rem,3.5vw,3rem); }
.ms-entry-content a { color: var(--ms-gold-soft); text-decoration: underline; text-decoration-color: rgba(231,183,95,.45); text-underline-offset: 4px; }
.ms-entry-content .wp-block-button__link { background: var(--ms-gold); color: #171006; border-radius: 999px; text-decoration: none; font-weight: 800; }
.ms-entry-content .wp-block-image img { box-shadow: var(--ms-shadow); }
.ms-single-header { padding-bottom: 34px; margin-bottom: 46px; border-bottom: 1px solid var(--ms-line); }
.ms-single-header > p:last-child { color: var(--ms-muted); }
.ms-back { display: inline-block; margin-top: 48px; color: var(--ms-gold-soft); font-size: .78rem; }

/* Collection page */
.ms-collections-page { padding-top: 18px; }
.ms-collection-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.ms-collection-card { min-height: 310px; position: relative; overflow: hidden; border: 1px solid var(--ms-line); display: flex; align-items: flex-end; padding: 25px; background: #0a151f; transition: transform .3s ease, border-color .3s ease; }
.ms-collection-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.66) brightness(.68); transition: transform .45s ease, filter .45s ease; }
.ms-collection-card:hover { transform: translateY(-5px); border-color: rgba(231,183,95,.56); }
.ms-collection-card:hover > img { transform: scale(1.045); filter: saturate(.85) brightness(.76); }
.ms-card-scrim { position: absolute; inset: 0; background: linear-gradient(180deg,rgba(3,10,17,.02),rgba(3,10,17,.93)); }
.ms-card-number { position: absolute; top: 20px; left: 22px; z-index: 2; color: var(--ms-gold); font-size: .7rem; font-weight: 850; letter-spacing: .15em; }
.ms-card-copy { position: relative; z-index: 2; display: grid; gap: 8px; max-width: 88%; }
.ms-card-copy strong { font: 900 1.45rem/1.05 var(--ms-display); letter-spacing: .04em; text-transform: uppercase; }
.ms-card-copy small { color: #c6cbd0; font-size: .78rem; line-height: 1.45; }
.ms-card-arrow { position: absolute; z-index: 2; right: 22px; bottom: 22px; color: var(--ms-gold); font-size: 1.25rem; }

/* Archives */
.ms-book-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 42px 24px; }
.ms-book-card { min-width: 0; }
.ms-book-cover { display: block; aspect-ratio: 2/3; overflow: hidden; background: #0c1721; box-shadow: 0 18px 46px rgba(0,0,0,.33); }
.ms-book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .42s ease; }
.ms-book-card:hover .ms-book-cover img { transform: scale(1.025); }
.ms-book-card h3 { margin: 17px 0 8px; font: 800 1.08rem/1.2 var(--ms-sans); }
.ms-book-card > p { margin: 0 0 10px; color: var(--ms-muted); font-size: .78rem; line-height: 1.5; }
.ms-book-link { color: var(--ms-gold-soft); font-size: .69rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.navigation.pagination { margin-top: 54px; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-links .page-numbers { min-width: 38px; min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ms-line); }
.nav-links .current { border-color: var(--ms-gold); color: var(--ms-gold); }

/* Footer */
.ms-footer { padding-top: 58px; border-top: 1px solid var(--ms-line); background: #02070c; }
.ms-footer-grid { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; }
.ms-footer-brand p { margin: 18px 0 0; color: var(--ms-muted); font: italic .95rem/1.4 var(--ms-serif); }
.ms-footer-links { display: flex; flex-wrap: wrap; gap: 25px; color: #b7c0c7; font-size: .77rem; }
.ms-footer-links a:hover { color: var(--ms-gold-soft); }
.ms-footer-bottom { min-height: 68px; margin-top: 48px; border-top: 1px solid var(--ms-line); display: flex; align-items: center; justify-content: space-between; color: #697783; font-size: .68rem; }

/* Gutenberg alignment */
.alignwide { max-width: 1120px; margin-left: 50%; transform: translateX(-50%); width: min(1120px,calc(100vw - 48px)); }
.alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); }

@media (max-width: 1180px) {
  .ms-shell { width: min(100% - 48px,var(--ms-shell)); }
  .ms-header-inner { gap: 22px; }
  .ms-nav { gap: 22px; }
  .ms-brand-copy strong { font-size: 1.2rem; }
  .ms-featured-books { gap: 24px; }
  .ms-featured-book { grid-template-columns: 42% 1fr; gap: 16px; }
  .ms-collection-strip { grid-template-columns: repeat(4,1fr); row-gap: 25px; }
  .ms-author-section { grid-template-columns: 32% 44% 24%; }
  .ms-author-copy { padding-inline: 42px; }
}

@media (max-width: 980px) {
  .admin-bar .ms-header { top: 32px; }
  .ms-header-inner { grid-template-columns: 1fr auto auto; }
  .ms-header-cta { display: none; }
  .ms-menu-toggle { display: inline-flex; grid-column: 3; }
  .ms-nav { position: fixed; inset: 77px 0 auto 0; max-height: calc(100vh - 77px); overflow: auto; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 14px 24px 28px; border-bottom: 1px solid var(--ms-line); background: rgba(3,10,17,.98); }
  .admin-bar .ms-nav { top: 109px; }
  .ms-menu-open .ms-nav { display: flex; }
  .ms-nav a { padding: 16px 2px; border-bottom: 1px solid var(--ms-line); }
  .ms-nav a::after { display: none; }
  .ms-hero { min-height: 660px; }
  .ms-hero-grid { min-height: 660px; grid-template-columns: 1fr; }
  .ms-hero-manifesto { display: none; }
  .ms-hero-backdrop img { object-position: 65% center; }
  .ms-hero-vignette { background: linear-gradient(90deg,rgba(3,10,17,.97) 0%,rgba(3,10,17,.78) 48%,rgba(3,10,17,.22) 100%),linear-gradient(180deg,transparent,rgba(3,10,17,.72)); }
  .ms-featured-books { grid-template-columns: 1fr; gap: 30px; }
  .ms-featured-book { grid-template-columns: minmax(150px,210px) 1fr; max-width: 650px; }
  .ms-collection-grid { grid-template-columns: repeat(2,1fr); }
  .ms-book-grid { grid-template-columns: repeat(3,1fr); }
  .ms-author-section { grid-template-columns: 38% 62%; }
  .ms-author-quote { grid-column: 1 / -1; padding: 34px 48px; border-top: 1px solid var(--ms-line); }
}

@media (max-width: 782px) {
  .admin-bar .ms-header { top: 46px; }
  .admin-bar .ms-nav { top: 123px; }
}

@media (max-width: 720px) {
  .ms-shell, .ms-narrow { width: min(100% - 30px,var(--ms-shell)); }
  .ms-header-inner { min-height: 70px; }
  .ms-brand-copy strong { font-size: 1.02rem; letter-spacing: .13em; }
  .ms-brand-copy small { font-size: .51rem; letter-spacing: .22em; }
  .ms-nav { top: 71px; }
  .admin-bar .ms-nav { top: 117px; }
  .ms-hero, .ms-hero-grid { min-height: 690px; }
  .ms-hero-grid { padding-block: 38px; }
  .ms-hero h1 { font-size: clamp(3.15rem,13vw,4.8rem); }
  .ms-lead br { display: none; }
  .ms-hero-backdrop img { object-position: 72% center; }
  .ms-hero-vignette { background: linear-gradient(90deg,rgba(3,10,17,.96),rgba(3,10,17,.62)),linear-gradient(180deg,rgba(3,10,17,.05),rgba(3,10,17,.76)); }
  .ms-actions { gap: 10px; }
  .ms-button { min-height: 45px; padding-inline: 20px; }
  .ms-home-section { padding-block: 28px 32px; }
  .ms-home-heading { align-items: flex-end; }
  .ms-home-heading h2 { font-size: 1.05rem; }
  .ms-featured-book { grid-template-columns: 42% 1fr; gap: 15px; }
  .ms-featured-copy p { min-height: 0; }
  .ms-collection-strip { grid-template-columns: repeat(2,1fr); }
  .ms-author-section { grid-template-columns: 1fr; }
  .ms-author-visual { min-height: 320px; }
  .ms-author-visual.has-image { background-size: auto 72%; }
  .ms-author-copy { padding: 40px 28px; }
  .ms-author-quote { padding: 30px 28px 40px; }
  .ms-collection-grid { grid-template-columns: 1fr; }
  .ms-book-grid { grid-template-columns: repeat(2,1fr); gap: 34px 16px; }
  .ms-footer-grid, .ms-footer-bottom { align-items: flex-start; flex-direction: column; }
  .ms-footer-bottom { justify-content: center; gap: 8px; padding-block: 18px; }
}

@media (max-width: 460px) {
  .ms-brand-copy small { display: none; }
  .ms-hero h1 { font-size: 3.12rem; }
  .ms-hero-quote { font-size: .9rem; }
  .ms-featured-book { grid-template-columns: 1fr 1.08fr; }
  .ms-featured-copy h3 { font-size: 1rem; }
  .ms-featured-copy p { font-size: .74rem; }
  .ms-outline-link { padding-inline: 14px; }
  .ms-collection-tile small { font-size: .62rem; }
  .ms-page-title, .ms-entry-title { font-size: 2.9rem; }
}
