/*
Theme Name: Fotografo Editoriale
Theme URI: https://example.local/
Author: Codex
Description: Tema WordPress per fotografo con home, gallery ad album, blog itinerari e contatti.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: fotografo-editoriale
*/

:root {
  --ink: #151515;
  --muted: #707070;
  --line: #e6e0d7;
  --paper: #fbfaf7;
  --soft: #f1eee8;
  --charcoal: #20201e;
  --accent: #9b5d3f;
  --accent-dark: #71422e;
  --white: #fff;
  --max: 1180px;
  --shadow: 0 24px 70px rgba(21, 21, 21, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 247, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.home .site-header {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, .42);
  border-bottom-color: rgba(255,255,255,.2);
}

.home { overflow: hidden; }
.home .site-footer { display: none; }

.home .brand, .home .main-menu a { color: #fff; font-weight: 700; }
.home .main-menu a:hover, .home .main-menu .current-menu-item > a { color: #fff; }
.home .main-menu a::after { background: #fff; height: 2px; }

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.brand img {
  max-height: 48px;
  width: auto;
}

.brand-mark {
  width: auto;
  height: auto;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  display: inline;
  padding: 0 !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .08em;
}

.main-menu {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.main-menu a {
  position: relative;
  color: var(--muted);
  transition: color .2s ease;
}

.main-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--ink);
  transition: transform .2s ease;
}

.main-menu a:hover,
.main-menu .current-menu-item > a {
  color: var(--ink);
}

.main-menu a:hover::after,
.main-menu .current-menu-item > a::after {
  transform: scaleX(1);
}

.menu-toggle { display: none; }

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  align-items: end;
  background: var(--soft);
  position: relative;
  overflow: hidden;
}

.home .hero { min-height: 100vh; }

.hero.no-image {
  background:
    linear-gradient(120deg, rgba(21,21,21,.74), rgba(21,21,21,.18)),
    var(--soft);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slides { position: absolute; inset: 0; }
.hero-slide { opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.is-active { opacity: 1; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 74% 30%, rgba(255,255,255,.12), transparent 26%),
    linear-gradient(90deg, rgba(0,0,0,.68), rgba(0,0,0,.12) 62%, rgba(0,0,0,.34));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 92px;
  color: var(--white);
}

.hero-content::before {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  margin-bottom: 22px;
  background: rgba(255,255,255,.72);
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

h1, h2, h3 {
  line-height: 1.05;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 { max-width: 760px; font-size: clamp(46px, 8vw, 108px); }
.hero-content h1 { max-width: none; white-space: nowrap; font-size: clamp(30px, 7vw, 108px); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 500; letter-spacing: .025em; text-shadow: 0 3px 20px rgba(0,0,0,.28); }
.hero-content .lead { font-size: clamp(38px, 6vw, 76px); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 500; letter-spacing: .02em; color: #fff; text-shadow: 0 3px 18px rgba(0,0,0,.36); }
h2 { font-size: clamp(34px, 4.4vw, 64px); }
h3 { font-size: 26px; }

.lead {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 18px;
}

.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid currentColor;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.btn.secondary {
  background: transparent;
  color: inherit;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--accent);
}

.btn.secondary:hover {
  background: var(--white);
  color: var(--ink);
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 86px 24px;
}

.section.alt {
  max-width: none;
  background: var(--charcoal);
  color: var(--white);
}

.section.alt > .section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section.alt .section-head p,
.section.alt .card-body p {
  color: rgba(255,255,255,.68);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 34px;
}

.section-head p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-card,
.post-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.gallery-card { aspect-ratio: 4 / 3; background: #161616; border: 0; }
.gallery-card > a { display: block; height: 100%; position: relative; }
.gallery-card img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.gallery-card-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: end; padding: 24px; color: #fff; background: linear-gradient(transparent 28%, rgba(0,0,0,.82)); opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.gallery-card:hover .gallery-card-overlay, .gallery-card:focus-within .gallery-card-overlay { opacity: 1; transform: translateY(0); }
.gallery-card-overlay .meta { color: rgba(255,255,255,.78); margin: 0 0 8px; }
.gallery-card-overlay h3 { font-size: clamp(24px, 3vw, 38px); }
.gallery-card-overlay span { margin-top: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.gallery-archive-section { background: var(--charcoal); max-width: none; }
.gallery-archive-section > .section-inner { max-width: var(--max); margin: 0 auto; }

.gallery-card:hover,
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.gallery-card img,
.post-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}

.gallery-card:hover img,
.post-card:hover img {
  transform: scale(1.035);
  filter: saturate(1.05) contrast(1.03);
}

.post-card img { aspect-ratio: 16 / 11; }

.card-body { padding: 18px; }
.card-body p { color: var(--muted); margin: 10px 0 0; }
.meta { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }

.gallery-card .meta,
.post-card .meta {
  margin-bottom: 8px;
}

.masonry {
  column-count: 3;
  column-gap: 18px;
}

.masonry figure {
  break-inside: avoid;
  margin: 0 0 18px;
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
}

.masonry img { width: 100%; }
.masonry img:hover { filter: contrast(1.04) saturate(1.05); }
.masonry figcaption { padding: 10px 12px; color: var(--muted); font-size: 13px; }
.masonry .gallery { display: block; column-count: 3; column-gap: 18px; margin: 0; padding: 0; }
.masonry .gallery-item { display: inline-block; width: 100%; margin: 0 0 18px; padding: 0; vertical-align: top; break-inside: avoid; }
.masonry .gallery-item img { display: block; width: 100%; height: auto; }
.gallery-title { max-width: 900px; font-size: clamp(38px, 6vw, 76px); }
.gallery-photo { break-inside: avoid; margin: 0 0 24px; background: #111; }
.gallery-photo a { display: block; }
.gallery-photo img { width: 100%; height: auto; }

.photo-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 5vw; background: rgba(8,8,8,.92); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.photo-lightbox.is-open { opacity: 1; pointer-events: auto; }
.photo-lightbox img { max-width: 92vw; max-height: 88vh; width: auto; height: auto; object-fit: contain; }
.photo-lightbox-close { position: absolute; top: 18px; right: 24px; border: 0; background: none; color: #fff; font-size: 42px; line-height: 1; cursor: pointer; }
.photo-lightbox-prev, .photo-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; height: 72px; border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 58px; line-height: 1; cursor: pointer; transition: background .2s ease; }
.photo-lightbox-prev:hover, .photo-lightbox-next:hover { background: rgba(155,93,63,.82); }
.photo-lightbox-prev { left: 18px; }
.photo-lightbox-next { right: 18px; }
.photo-lightbox-counter { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.82); font-size: 13px; letter-spacing: .08em; }
.masonry a, .gallery a { cursor: zoom-in; }
@media (max-width: 860px) { .masonry .gallery { column-count: 2; } }
@media (max-width: 560px) { .masonry .gallery { column-count: 1; } }

.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 74px 24px 34px;
}

.page-hero::after {
  content: "";
  display: block;
  width: 92px;
  height: 1px;
  margin-top: 28px;
  background: var(--accent);
}

.page-hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.post-hero { min-height: min(68vh, 720px); position: relative; display: flex; align-items: end; overflow: hidden; background: var(--charcoal); color: #fff; }
.post-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.08) 75%), linear-gradient(0deg, rgba(0,0,0,.72), transparent 58%); }
.post-hero.no-image { min-height: 420px; }
.post-hero-overlay { position: relative; z-index: 1; width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 100px 0 76px; }
.post-hero-overlay h1 { max-width: 920px; font-size: clamp(42px, 7vw, 92px); }
.post-hero-overlay .eyebrow { color: rgba(255,255,255,.78); }
.post-content { max-width: 820px; padding-top: 72px; font-size: 18px; line-height: 1.8; }
.post-actions { margin-bottom: 34px; }
.post-actions .btn { cursor: pointer; }
.post-content p { margin: 0 0 1.5em; }
.blog-layout { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
.blog-main.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blog-sidebar { position: sticky; top: 104px; padding: 24px; background: var(--white); border: 1px solid var(--line); }
.sidebar-block + .sidebar-block { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.sidebar-block h2 { font-family: Inter, system-ui, sans-serif; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 16px; }
.blog-sidebar .search-form { display: flex; gap: 8px; }
.blog-sidebar .search-field { min-width: 0; }
.blog-sidebar .search-submit { border: 0; padding: 0 12px; background: var(--ink); color: #fff; cursor: pointer; }
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.category-list a { color: var(--ink); }
.category-list .count { color: var(--accent); font-size: 12px; }
.post-layout { padding: 0 24px 86px; }
.post-layout .post-content { padding-left: 0; padding-right: 0; }
.post-navigation { display: flex; justify-content: space-between; gap: 18px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.post-navigation a { color: var(--accent-dark); font-weight: 700; }
.post-navigation a:hover { color: var(--accent); }

.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 24px 86px;
}

.content a { color: var(--accent-dark); text-decoration: underline; }
.content p { margin: 0 0 1.1em; }

.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 34px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.contact-panel h2 { font-size: clamp(30px, 4vw, 52px); margin-bottom: 16px; }
.contact-panel .btn { cursor: pointer; }
.contact-logo { display: block; width: 100%; max-width: 520px; max-height: 240px; object-fit: contain; object-position: left center; margin: 0 0 24px; }
.contact-logo-link { display: block; }
.contact-email { font-size: 22px; margin: 0; }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.contact-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }

input, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 12px;
  font: inherit;
  transition: border-color .2s ease, background .2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

textarea { min-height: 150px; resize: vertical; }
label { display: block; margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.form-notice { padding: 12px 14px; margin: 0 0 20px; border-left: 3px solid var(--accent); background: var(--soft); }
.form-notice.success { border-color: #4b8b5a; }
.form-notice.error { border-color: #ad4b4b; }
.contact-map-section { padding-top: 0; }
.contact-kicker { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.contact-panel h2, .contact-map-wrap h2 { font-size: clamp(30px, 4vw, 52px); margin-bottom: 16px; }
.contact-content .content-editorial { max-width: none; padding: 0; }
.contact-map-wrap { margin-top: 48px; }
.contact-map { min-height: 420px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); box-shadow: var(--shadow); }
.contact-map iframe { display: block; width: 100%; min-height: 420px; border: 0; }
.page-intro { max-width: 760px; color: var(--muted); font-size: 18px; }
.page-intro p { margin: 18px 0 0; }
.cookie-banner { position: fixed; left: 24px; right: 24px; bottom: 20px; z-index: 1100; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; background: rgba(32,32,30,.96); color: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.cookie-banner p { margin: 0; font-size: 14px; }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner button { border: 1px solid #fff; padding: 10px 18px; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 24px;
  color: var(--muted);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    background: transparent;
    padding: 8px 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
  }

  .main-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 71px;
    padding: 18px 24px;
    flex-direction: column;
    align-items: start;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .home .main-menu { background: rgba(10,10,10,.92); }

  body.menu-open .main-menu { display: flex; }
  .grid { grid-template-columns: 1fr; }
  .masonry { column-count: 1; }
  .section-head { display: block; }
  .contact-panel { grid-template-columns: 1fr; padding: 22px; }
  .footer-inner { display: block; }
  .post-hero { min-height: 58vh; }
  .post-hero-overlay { width: min(var(--max), calc(100% - 36px)); padding-bottom: 48px; }
  .post-content { padding-top: 48px; font-size: 17px; }
  .post-navigation { display: grid; }
  .blog-layout { display: block; }
  .blog-sidebar { position: static; margin-top: 42px; }
  .blog-main.grid { grid-template-columns: 1fr; }
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; display: block; }
  .cookie-banner button { margin-top: 12px; }
}

@media print {
  .site-header, .site-footer, .blog-sidebar, .post-actions, .post-navigation, .cookie-banner, .admin-bar { display: none !important; }
  .post-hero { min-height: 360px; page-break-after: avoid; }
  .post-hero > img { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .post-layout { display: block; padding: 0; }
  .post-content { max-width: 100%; padding: 28px 0; font-size: 12pt; line-height: 1.6; }
  .post-content p { orphans: 3; widows: 3; }
  a { color: #000; text-decoration: none; }
}
