/*
Theme Name: Condomio
Theme URI: https://www.condomio.it/
Author: Condomio srls
Description: Tema restyling per Condomio srls — amministrazione condominiale a Roma.
Version: 1.5.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Text Domain: condomio
*/

:root {
  --ink: #15202b;
  --ink-soft: #2c3a4a;
  --paper: #eef1f4;
  --paper-deep: #e2e7ed;
  --surface: #ffffff;
  --accent: #b42318;
  --accent-hover: #8f1a12;
  --line: rgba(21, 32, 43, 0.12);
  --muted: #5c6b7a;
  --radius: 4px;
  --shadow: 0 18px 40px rgba(21, 32, 43, 0.12);
  --font-display: "Newsreader", "Times New Roman", serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --max: 1120px;
  --header-h: 112px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(180, 35, 24, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(44, 58, 74, 0.08), transparent 50%),
    linear-gradient(180deg, #f5f7fa 0%, var(--paper) 40%, #e8edf2 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(238, 241, 244, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: none;
  margin: 0;
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  margin-right: auto;
  margin-left: 0;
}

.brand img,
.brand .custom-logo {
  width: 150px !important;
  height: 100px !important;
  max-width: 150px;
  object-fit: contain;
  object-position: left center;
}

.brand .custom-logo-link {
  display: block;
  line-height: 0;
}

.nav-toggle {
  display: none;
  order: 3;
  border: 1px solid var(--line);
  background: var(--surface);
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 4px auto;
}

.primary-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.primary-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.15rem 1.1rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.primary-nav li {
  position: relative;
}

.primary-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 400;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .current-menu-ancestor > a {
  color: var(--accent);
}

.primary-nav .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.primary-nav .menu-item-has-children > a::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}

.primary-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0.45rem 0;
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  min-width: 11.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 20;
}

.primary-nav .menu-item-has-children:hover > .sub-menu,
.primary-nav .menu-item-has-children:focus-within > .sub-menu,
.primary-nav .menu-item-has-children.is-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.primary-nav .sub-menu a {
  display: block;
  padding: 0.55rem 0.95rem;
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 400;
}

.primary-nav .sub-menu a:hover {
  background: rgba(180, 35, 24, 0.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(180, 35, 24, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.header-cta {
  flex-shrink: 0;
  margin-left: auto;
  order: 2;
}

.header-cta .btn {
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
}

.site-main {
  min-height: 50vh;
}

/* Hero banner (immagine storica con nome sito) */
.hero {
  position: relative;
  overflow: hidden;
  background: #5a2a22;
}

.hero-banner {
  min-height: 0;
  display: block;
}

.hero-banner .hero-media {
  position: relative;
  inset: auto;
  line-height: 0;
}

.hero-banner .hero-media::after {
  display: none;
}

.hero-banner .hero-media img {
  width: 100%;
  height: auto;
  max-height: min(42vh, 420px);
  object-fit: cover;
  object-position: center top;
  display: block;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.25rem;
}

.section-head {
  margin-bottom: 2rem;
  max-width: none;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.section-head p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: rise 0.7s ease both;
}

.news-card:nth-child(2) { animation-delay: 0.08s; }
.news-card:nth-child(3) { animation-delay: 0.16s; }

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.news-card-media {
  aspect-ratio: 16 / 10;
  background: var(--paper-deep);
  overflow: hidden;
}

.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-media img {
  transform: scale(1.04);
}

.news-card-body {
  padding: 1.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.news-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.news-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.news-card h3 a {
  color: inherit;
  text-decoration: none;
}

.news-card h3 a:hover {
  color: var(--accent);
}

.news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.news-card-intro .news-card-body {
  min-height: auto;
}

.news-card-intro .news-card-body > p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .more {
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--accent);
}

.section-foot {
  margin-top: 1.75rem;
}

/* Page content */
.page-hero {
  background: var(--accent);
  color: #fff;
  padding: 3.25rem 1.25rem 2.85rem;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.12), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.12), transparent 40%);
  pointer-events: none;
}

.page-hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
}

.page-hero .breadcrumb {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
}

.page-hero .breadcrumb a {
  color: #fff;
  text-decoration: none;
}

.page-hero .breadcrumb a:hover {
  text-decoration: underline;
}

.content-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.25rem 4.5rem;
}

.entry-content {
  font-size: 1.05rem;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content h2,
.entry-content h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.entry-content h2 {
  font-size: 1.85rem;
  margin: 2.5rem 0 1rem;
  color: var(--accent);
}

.entry-content h3,
.entry-content h6 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.5rem;
}

.entry-content p {
  margin: 0 0 1rem;
}

.entry-content iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
  margin-top: 1.5rem;
}

/* Team / directory helpers */
.team-grid,
.directory-grid,
.numbers-grid,
.contact-grid {
  display: grid;
  gap: 1.25rem;
}

.team-grid {
  grid-template-columns: repeat(2, 1fr);
}

.person-card,
.dir-card,
.number-card,
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.35rem 1.4rem;
}

.dir-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dir-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.dir-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: rgba(180, 35, 24, 0.08);
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.person-card img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.person-card h3,
.dir-card h3,
.number-card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.person-card .role {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.studio-box,
.entry-content .studio-box {
  margin-top: 2.5rem;
  padding: 2.25rem 1.75rem;
  background:
    radial-gradient(circle at 12% 20%, rgba(180, 35, 24, 0.1), transparent 45%),
    var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  text-align: center;
}

.studio-box h2,
.entry-content .studio-box h2 {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  text-align: center;
}

.studio-box p,
.entry-content .studio-box p {
  margin: 0 auto 0.85rem;
  max-width: 36rem;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink);
  text-align: center;
}

.studio-box .studio-box-note,
.entry-content .studio-box .studio-box-note {
  display: block;
  max-width: none !important;
  width: 100% !important;
  margin: 1.35rem 0 0 !important;
  padding: 0;
  text-align: center !important;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.directory-grid {
  grid-template-columns: repeat(2, 1fr);
}

.dir-card a,
.number-card a,
.contact-card a {
  font-weight: 600;
  text-decoration: none;
}

.dir-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.numbers-grid {
  grid-template-columns: repeat(2, 1fr);
}

.number-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.number-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.number-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 5.5rem;
  padding: 0.75rem;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.number-logo img {
  max-height: 4.5rem;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.number-card .phone {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
  text-decoration: none;
}

.contact-grid {
  grid-template-columns: 1fr 1.2fr;
  align-items: start;
}

.map-embed {
  border: 1px solid var(--line);
  min-height: 360px;
  background: var(--paper-deep);
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
}

/* Single post */
.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Footer */
/* Dualcode / Condomio On-line banner */
.dualcode-banner {
  padding: 1.75rem 1.25rem 2rem;
  background:
    radial-gradient(ellipse 50% 80% at 100% 0%, rgba(255, 122, 24, 0.12), transparent 55%),
    linear-gradient(180deg, #f8f9fb 0%, #eef1f4 100%);
  border-top: 1px solid var(--line);
}

.dualcode-banner-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 1.75rem;
}

.dualcode-banner-link {
  display: block;
  flex: 1 1 280px;
  max-width: 728px;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(21, 32, 43, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dualcode-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(21, 32, 43, 0.14);
}

.dualcode-banner-link img {
  width: 100%;
  height: auto;
  display: block;
}

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  padding: 3rem 1.25rem 2rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #fff;
  margin: 0 0 0.5rem;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffb4ae;
}

.footer-col h4 {
  margin: 0 0 0.85rem;
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col p,
.footer-col li {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-bottom {
  max-width: var(--max);
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Forms / WP defaults */
.wp-block-search__input,
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

/* Responsive */
@media (max-width: 900px) {
  .header-inner {
    position: relative;
  }

  .nav-toggle {
    display: inline-block;
  }

  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.25rem;
    justify-content: flex-start;
    z-index: 50;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav > ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .primary-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0.35rem 0 0.35rem 0.85rem;
    min-width: 0;
    display: none;
  }

  .primary-nav .menu-item-has-children.is-open > .sub-menu {
    display: block;
  }

  .header-cta .btn {
    padding: 0.55rem 0.8rem;
    font-size: 0.8rem;
  }

  .news-grid,
  .numbers-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .news-grid,
  .team-grid,
  .directory-grid,
  .numbers-grid {
    grid-template-columns: 1fr;
  }

  .hero-banner .hero-media img {
    max-height: min(32vh, 280px);
  }

  .section-head h2 {
    white-space: nowrap;
    font-size: clamp(1.15rem, 4.8vw, 1.55rem);
  }
}
