/*
Theme Name: Porcino
Description: Tema di Porcino.ai: leggero, veloce, con font ospitati sul sito (nessuna chiamata a Google Fonts).
Version: 1.0.4
Requires at least: 6.2
Requires PHP: 7.4
Author: Porcino.ai
License: GPL-2.0-or-later
Text Domain: porcino-theme
*/

/* Layout: field-guide page — slim sticky header, wide content band for maps, readable 68ch text column. */
@font-face { font-family: "Literata"; src: url("fonts/literata-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Literata"; src: url("fonts/literata-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f1f2ec; --surface: #ffffff; --ink: #17241b; --muted: #5b675e; --line: #d5d9cf;
  --forest: #1f4a32; --cap: #7a3a17; --ochre: #c0862b; --sand: #e3cf96;
  --display: "Literata", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --wide: 1240px; --text: 70ch;
  /* map and content blocks follow the theme */
  --pc-ink: var(--ink); --pc-muted: var(--muted); --pc-line: var(--line); --pc-surface: var(--surface); --pc-paper: var(--paper);
  --pc-forest: var(--forest); --pc-cap: var(--cap); --pc-ochre: var(--ochre); --pc-sand: var(--sand);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1712; --surface: #16211a; --ink: #e6ebe3; --muted: #9aa79d; --line: #2b372f;
    --forest: #7cc09a; --cap: #d9905f; --ochre: #d9a54c; --sand: #6b5a2c; color-scheme: dark;
  }
}

.pm-root { --pm-bg: var(--paper); --pm-surface: var(--surface); --pm-fg: var(--ink); --pm-muted: var(--muted); --pm-line: var(--line); --pm-forest: var(--forest); --pm-on-forest: var(--surface); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--forest); text-underline-offset: 2px; }
a:hover { color: var(--cap); }
:focus-visible { outline: 2px solid #1f6fd1; outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.18; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 700; margin: .2em 0 .5em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; margin: 1.8em 0 .5em; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 1.4em 0 .4em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 2000; width: auto; height: auto; clip: auto; background: var(--surface); padding: 8px 12px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* header */
.site-header { position: sticky; top: 0; z-index: 1100; background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.site-header .wrap { display: flex; align-items: center; gap: 12px 24px; padding-block: 12px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.45rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--cap); }
.brand img { max-height: 40px; width: auto; display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 18px; flex-wrap: wrap; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: .97rem; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a, .main-nav .current-menu-ancestor > a { color: var(--cap); }
.header-account { margin-left: auto; display: flex; gap: 8px; }
.btn { display: inline-block; font: 600 .9rem/1.2 var(--body); border-radius: 999px; padding: 8px 16px; text-decoration: none; border: 1px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; }
.btn-primary { background: var(--cap); border-color: var(--cap); color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.1); }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; margin-left: auto; }
  .main-nav { display: none; width: 100%; order: 3; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 10px; padding: 8px 0 4px; }
  .header-account { margin-left: 0; }
}

/* content */
.site-main { padding-block: 28px 56px; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumbs a { color: var(--muted); }
.entry-header { max-width: var(--text); }
.entry-meta { color: var(--muted); font-size: .9rem; margin-top: -.6em; margin-bottom: 1.2em; }
.entry-content > * { max-width: var(--text); }
.entry-content > .pc-wide, .entry-content > .porcino-map, .entry-content > .pc-zone, .entry-content > .pc-region,
.entry-content > .pc-table, .entry-content > .pc-cards, .entry-content > .pc-news, .entry-content > .alignwide,
.entry-content > .alignfull, .entry-content > .pa-box, .entry-content > .pb-board { max-width: none; }
.entry-content .pc-zone > *, .entry-content .pc-region > * { max-width: var(--text); }
.entry-content .pc-zone > .porcino-map, .entry-content .pc-region > .porcino-map, .entry-content .pc-region > .pc-cards,
.entry-content .pc-zone > .pc-news, .entry-content .pc-region > .pc-news { max-width: none; }
.entry-content p, .entry-content li { font-size: 1.02rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content blockquote { margin: 1.5em 0; padding: .2em 1.2em; border-left: 3px solid var(--cap); color: var(--muted); }
.entry-content figure { margin: 1.5em 0; }
.entry-content figcaption { font-size: .85rem; color: var(--muted); }
.post-thumb { margin: 0 0 1.5em; border-radius: 12px; overflow: hidden; max-width: 900px; }

.front .entry-header { display: none; }
.front-hero { margin-bottom: 14px; }
.front-hero h1 { margin: 0; }
.front-hero h1 em { font-style: normal; color: var(--cap); }
.front-hero p { margin: 0; color: var(--muted); max-width: 46ch; }

/* post lists */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.post-card .post-card-body { padding: 16px 18px 20px; }
.post-card h2 { font-size: 1.25rem; margin: .2em 0 .4em; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card time { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.post-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.pagination { margin-top: 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.pagination .current { background: var(--forest); color: var(--surface); border-color: var(--forest); }

/* forms and comments */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], textarea, select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; max-width: 100%;
}
button, input[type="submit"] { font: 600 .95rem var(--body); background: var(--forest); color: var(--surface); border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer; }
.comments { max-width: var(--text); margin-top: 48px; border-top: 1px solid var(--line); padding-top: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { border-bottom: 1px solid var(--line); padding: 12px 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px 44px; color: var(--muted); font-size: .88rem; }
.site-footer .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.site-footer b { color: var(--ink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.site-footer .n112 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: #b3261e; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: minmax(0, 1fr); } }

.error-404 { max-width: var(--text); padding-block: 40px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
