/* Studio Longo theme: WordPress-specific rules. The look of the site is the approved draft, in bozza.css. */

/* Fonts served from the site (no request to Google), Latin subset only, licence SIL OFL 1.1 (assets/fonts/OFL-*):
   Cormorant Garamond 500, 600 and 700 (@fontsource/cormorant-garamond 5.3.0) and DM Sans with its weight and
   optical size axes (@fontsource-variable/dm-sans 5.3.0), the same faces the draft loaded from Google Fonts.
   No italic files, as in the draft: the browser slants the normal face. */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("../fonts/dm-sans-latin-opsz-normal.woff2") format("woff2-variations"), url("../fonts/dm-sans-latin-opsz-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Text for screen readers only, the class WordPress uses in its own markup. */
.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; }

/* The sticky header stays below the admin bar of a logged-in editor. */
.admin-bar .site-head { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-head { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-head { top: 0; } }

/* Request form: the field for bots stays out of sight and out of the tab order; the outcome of an error in bordeaux. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#esito.is-error { color: var(--bordeaux); }
.check a { color: inherit; }

/* Legal pages (privacy, cookie): their many sub-headings. */
.prose h3 { font-size: 26px; margin: 26px 0 10px; }

/* Web addresses written out in the text (the privacy policy quotes several in full) wrap inside the column. Longer
   than a phone is wide, they widened the column and the page sideways (59 px too wide at 390 px); e-mail addresses
   already wrap so in bozza.css. */
.prose a { overflow-wrap: anywhere; }

/* Newsletter box of the articles (inc/newsletter.php): the request form's field and consent at the width of the
   side column; below 960 px, where the column takes the page's width, they stop at a comfortable width. The page of
   the link has short notices, left-aligned like the draft's short texts (justified, a line before an e-mail address
   gaped on phones); the address being confirmed has a line of its own and wraps on narrow phones. */
.nl form { max-width: 460px; }
.nl .check { margin: 14px 0 18px; }
.side #nl-esito { margin: 14px 0 0; font-size: 15px; }
#nl-esito.is-error, .prose .nl-errore { color: var(--bordeaux); }
.nl-pagina p { text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.nl-indirizzo { overflow-wrap: anywhere; }
.nl-conferma { margin: 4px 0 22px; }

/* Article cards without a photo yet: same frame as the photo. */
.news-ph { width: 100%; aspect-ratio: 16 / 10; background: #e9e0d6 url("../img/logo-studio-oro.png") center / 36px auto no-repeat; }

/* Images and captions added by the editors in the block editor. */
.prose figure { margin: 6px 0 24px; max-width: 68ch; }
.prose figure img { height: auto; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Cookie banner (inc/consent.php, assets/js/consent.js): a bar along the bottom of the screen until the visitor
   chooses. Accetta and Rifiuta look the same, as the Italian guidelines ask. While it is up, the page gets as much
   room at its end as the bar is tall, and a field reached with the keyboard is scrolled above it. */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--white); border-top: 1px solid var(--gold-soft); box-shadow: 0 -8px 28px rgba(43, 35, 38, 0.12); }
.consent[hidden], .consent-link[hidden] { display: none; }
.consent .wrap { position: relative; display: flex; align-items: center; gap: 14px 44px; padding-top: 20px; padding-bottom: 20px; padding-right: 72px; }
.consent-text { flex: 1 1 auto; max-width: 80ch; }
.consent h2 { font-size: 26px; margin-bottom: 4px; }
.consent p { font-size: 14.5px; line-height: 1.55; }
.consent p a, .consent-dialog p a { color: var(--bordeaux); }
.consent-actions { flex: none; display: flex; align-items: center; gap: 10px 12px; }
.consent-actions .btn { min-width: 116px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.consent-actions .link-btn { margin-right: 10px; font-size: 14.5px; font-weight: 600; color: var(--bordeaux); }
.consent-close { position: absolute; top: 12px; right: 16px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 2px; color: var(--muted); cursor: pointer; }
.consent-close:hover { background: #f8eef0; color: var(--bordeaux); }
html.has-consent { scroll-padding-bottom: calc(var(--consent-h, 0px) + 16px); }
html.has-consent body { padding-bottom: var(--consent-h, 0px); }
.site-foot .link-btn { text-decoration: none; }
.site-foot .link-btn:hover { text-decoration: underline; }

/* Cookie preferences: Google Maps can be switched on and off; the technical cookies are always on. */
.consent-dialog { position: fixed; inset: 0; z-index: 60; width: min(600px, calc(100% - 32px)); height: fit-content; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 32px 32px 28px; overflow-y: auto; overscroll-behavior: contain; background: var(--white); color: var(--ink); border: 1px solid var(--gold-soft); border-radius: 2px; box-shadow: 0 20px 60px rgba(43, 35, 38, 0.28); }
.consent-dialog::backdrop { background: rgba(43, 35, 38, 0.5); }
.consent-dialog h2 { font-size: 34px; margin: 0 44px 8px 0; }
.consent-dialog .consent-close { top: 14px; right: 14px; }
.consent-intro { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }
.consent-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.consent-item h3 { font: 600 16px/1.35 "DM Sans", Arial, sans-serif; color: var(--ink); }
.consent-item h3 label { cursor: pointer; }
.consent-item p { grid-column: 1 / -1; font-size: 14px; line-height: 1.55; color: var(--muted); }
.consent-always { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.consent-switch { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 46px; height: 26px; margin: 0; border: 1.5px solid var(--muted); border-radius: 13px; background: var(--white); cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.consent-switch::before { content: ""; position: absolute; top: 3.5px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background-color 0.15s; }
.consent-switch:checked { background: var(--bordeaux); border-color: var(--bordeaux); }
.consent-switch:checked::before { background: var(--white); transform: translateX(19px); }
.consent-dialog-actions { display: flex; justify-content: flex-end; padding-top: 20px; border-top: 1px solid var(--line); }

@media (max-width: 899px) {  /* text above at full width, then one row: Personalizza, Rifiuta and Accetta (these two equal) */
  .consent .wrap { flex-direction: column; align-items: stretch; padding-top: 16px; padding-bottom: 14px; padding-right: 24px; }
  .consent h2 { font-size: 24px; margin: 0 44px 8px 0; }  /* the X (40 px tall) sits beside the heading, clear of the text */
  .consent-actions { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); max-width: 560px; }
  .consent-actions .btn { min-width: 0; padding-left: 12px; padding-right: 12px; }
  .consent-actions .link-btn { margin-right: 4px; }
  .consent-close { top: 8px; right: 10px; }
}
@media (max-width: 319px) {  /* very narrow screens: Personalizza on its own row under the two buttons */
  .consent-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .consent-actions .link-btn { order: 3; grid-column: 1 / -1; justify-self: center; margin: 0; padding: 4px 0; }
}
@media (max-width: 640px) {
  .consent-dialog { padding: 26px 20px 22px; }
  .consent-dialog h2 { font-size: 30px; }
  .consent-dialog-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .consent-switch, .consent-switch::before { transition: none; }
}
@media (forced-colors: active) {  /* high contrast: the switch keeps its outline and shows its state */
  .consent-switch { border-color: CanvasText; }
  .consent-switch::before { background: CanvasText; }
  .consent-switch:checked { background: Highlight; border-color: Highlight; }
  .consent-switch:checked::before { background: Canvas; }
}
@media print {
  .consent, .consent-dialog, .consent-link { display: none !important; }
}

/* Blog pages beyond the first. */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { display: inline-block; min-width: 40px; padding: 8px 12px; border: 1px solid var(--gold-soft); text-align: center; text-decoration: none; color: var(--bordeaux); }
.pagination .page-numbers.current { background: var(--bordeaux); border-color: var(--bordeaux); color: var(--white); }

/* Phones narrower than 340 px, below the widths the draft was checked at (360 px and up). A heading word wider than
   its box ("approfondimenti" on the home page and, under 288 px, in the articles' side column; "sovraindebitamento"
   on the practice areas page) pushed the box, and under 300 px the page, sideways. Such a word now breaks inside its
   box. In the headings where it happened it is hyphenated instead, and only words of 15 letters or more are:
   automatic hyphenation of every word would also re-break, through text-wrap: balance, headings that fit ("Richiedi
   una / consulenza"). overflow-wrap alone leaves them as they are. Under 310 px the name in the header ran under the
   menu button. */
@media (max-width: 339px) {
  h1, h2, h3 { overflow-wrap: anywhere; }
  .news-head h2 { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 15 6 6; }
}
@media (max-width: 319px) {
  .svc h2, .news h3, .prose h2, .side h2 { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 15 6 6; }
}
@media (max-width: 309px) {
  .brand strong { font-size: 16.5px; }
}
