/*
Theme Name: Dr. Abenavoli
Theme URI: https://www.francescoabenavoli.it
Author: Studio Abenavoli
Description: Tema WordPress sviluppato da Piero de Cindio
Version: 4.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: abenavoli
*/

/* ═══════════ VARIABLES ═══════════ */
:root {
  --dark: #364668;
  --dark-header: #465981;
  --dark-footer: #2a2a2a;
  --gold: #f0c040;
  --gold-hover: #f5d060;
  --white: #ffffff;
  --white-90: rgba(255,255,255,.9);
  --white-70: rgba(255,255,255,.7);
  --white-50: rgba(255,255,255,.5);
  --text-dark: #333333;
  --text-body: #555555;
  --border-light: rgba(255,255,255,.1);
  --font: 'Montserrat', sans-serif;
  --font-hand: 'Caveat', cursive;
  --font-serif: 'Playfair Display', Georgia, serif;
}

/* ═══════════ RESET ═══════════ */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;font-size:16px}
body{
  font-family:var(--font);
  font-weight:500;
  font-size:15px;
  line-height:1.7;
  color:var(--white-90);
  background:var(--dark);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none;transition:color .3s}
img{max-width:100%;height:auto;display:block}
ul,ol{list-style:none}

/* ═══════════ HEADER ═══════════ */

/* Top social bar - icons right-aligned */
.top-bar{
  background:var(--dark-header);
  padding:.5rem 3rem;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:1rem;
}
.top-bar a{
  color:var(--white-70);
  display:flex;
  align-items:center;
  transition:color .3s;
}
.top-bar a:hover{color:var(--white)}
.top-bar svg{width:18px;height:18px;fill:currentColor}

/* Main header: logo left, nav center-right, lang far right */
.site-header{
  background:var(--dark-header);
  position:sticky;
  top:0;
  z-index:9999;
  border-bottom:1px solid var(--border-light);
}

.header-inner{
  display:flex;
  align-items:center;
  padding:1rem 3rem;
  max-width:1600px;
  margin:0 auto;
}

/* Logo: DR thin FRANCESCO thin ABENAVOLI bold */
.site-logo{
  font-family:var(--font);
  font-size:1.65rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--white);
  white-space:nowrap;
  flex-shrink:0;
  line-height:1;
}
.site-logo .thin{font-weight:300}
.site-logo .bold{font-weight:700}

/* Desktop nav */
.desktop-nav{
  display:flex;
  align-items:center;
  gap:1.6rem;
  margin-left:2.5rem;
  flex-wrap:wrap;
}
.desktop-nav a{
  font-family:var(--font);
  font-size:.72rem;
  font-weight:500;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--white-70);
  padding:.3rem 0;
  white-space:nowrap;
  transition:color .3s;
}
.desktop-nav a:hover,
.desktop-nav a.current{color:var(--white)}

/* Language switcher */
.lang-switch{
  margin-left:auto;
  display:flex;
  gap:.3rem;
  font-size:.8rem;
  font-weight:500;
  flex-shrink:0;
}
.lang-switch a{color:var(--white-50)}
.lang-switch a:hover,.lang-switch a.active{color:var(--gold)}
.lang-switch span{color:var(--white-50)}

/* Hamburger (mobile only) */
.hamburger{
  display:none;
  cursor:pointer;
  width:30px;height:22px;
  position:relative;
  background:none;border:none;padding:0;
  z-index:10001;
  margin-left:1.5rem;
  flex-shrink:0;
}
.hamburger span{
  display:block;width:100%;height:2px;
  background:var(--white);position:absolute;
  transition:all .35s cubic-bezier(.77,0,.175,1);
}
.hamburger span:nth-child(1){top:0}
.hamburger span:nth-child(2){top:50%;transform:translateY(-50%)}
.hamburger span:nth-child(3){bottom:0}
.hamburger.active span:nth-child(1){top:50%;transform:translateY(-50%) rotate(45deg)}
.hamburger.active span:nth-child(2){opacity:0}
.hamburger.active span:nth-child(3){bottom:50%;transform:translateY(50%) rotate(-45deg)}

/* ═══════════ MOBILE MENU ═══════════ */
.mobile-menu{
  position:fixed;inset:0;
  background:rgba(45,45,45,.98);
  backdrop-filter:blur(10px);
  z-index:10000;
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  opacity:0;visibility:hidden;
  transition:opacity .4s,visibility .4s;
}
.mobile-menu.open{opacity:1;visibility:visible}
.mobile-menu-close{
  position:absolute;top:1.2rem;right:1.5rem;
  background:none;border:none;cursor:pointer;
  font-size:2.4rem;line-height:1;
  color:var(--white-70);
  transition:color .3s;
  z-index:10001;
  padding:0.5rem;
}
.mobile-menu-close:hover{color:var(--white)}
.mobile-menu .menu{text-align:center;list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:0}
.mobile-menu .menu li{margin:.4rem 0;overflow:hidden}
.mobile-menu .menu a{
  font-size:1.1rem;font-weight:500;letter-spacing:.2em;text-transform:uppercase;
  color:var(--white-70);display:inline-block;padding:.4rem 0;
  transform:translateY(100%);
  transition:transform .5s cubic-bezier(.77,0,.175,1),color .3s;
}
.mobile-menu.open .menu a{transform:translateY(0)}
.mobile-menu .menu li:nth-child(1) a{transition-delay:.05s}
.mobile-menu .menu li:nth-child(2) a{transition-delay:.08s}
.mobile-menu .menu li:nth-child(3) a{transition-delay:.11s}
.mobile-menu .menu li:nth-child(4) a{transition-delay:.14s}
.mobile-menu .menu li:nth-child(5) a{transition-delay:.17s}
.mobile-menu .menu li:nth-child(6) a{transition-delay:.20s}
.mobile-menu .menu li:nth-child(7) a{transition-delay:.23s}
.mobile-menu .menu li:nth-child(8) a{transition-delay:.26s}
.mobile-menu .menu li:nth-child(9) a{transition-delay:.29s}
.mobile-menu .menu li:nth-child(10) a{transition-delay:.32s}
.mobile-menu .menu li:nth-child(11) a{transition-delay:.35s}
.mobile-menu .menu a:hover{color:var(--white)}
.mobile-menu .menu .current-menu-item>a,.mobile-menu .menu .current_page_item>a{color:var(--gold)}
.mobile-menu .sub-menu{display:none}

/* ═══════════ HERO (homepage) ═══════════ */
.hero{
  min-height:calc(100vh - 120px);
  background:var(--dark);
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:stretch;
}

/* Hero photo: left side, B&W */
.hero-photo{
  width:50%;
  position:relative;
}
.hero-photo img{
  width:100%;height:100%;
  object-fit:cover;
  filter:grayscale(100%);
}
.hero-photo-placeholder{
  width:100%;height:100%;
  background:linear-gradient(135deg,#444,#555);
  display:flex;align-items:center;justify-content:center;
}
.hero-photo-placeholder span{
  font-size:.8rem;color:var(--white-50);letter-spacing:.1em;text-transform:uppercase;
}

/* Hero quote: right side */
.hero-content{
  width:50%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:4rem 4rem 4rem 5rem;
}

.hero-quote{
  font-family:var(--font-hand);
  font-size:clamp(1.6rem,3vw,2.4rem);
  font-weight:400;
  line-height:1.5;
  color:var(--white-90);
  margin-bottom:2rem;
}

.hero-author{
  font-family:var(--font);
  font-size:1rem;
  font-weight:700;
  color:var(--white);
  text-align:right;
}

/* Chevron down */
.hero-chevron{
  position:absolute;
  bottom:3rem;
  left:50%;
  transform:translateX(-50%);
  z-index:10;
}
.hero-chevron svg{
  width:40px;height:40px;
  stroke:var(--gold);
  stroke-width:2;
  fill:none;
  animation:bounceDown 2s ease infinite;
}

@keyframes bounceDown{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(8px)}
}

/* ═══════════ 3 BOXES (homepage bottom) ═══════════ */
.home-boxes{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:0;
}
.home-box{
  position:relative;
  aspect-ratio:4/3;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.home-box img{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:cover;
  filter:grayscale(100%);
  transition:transform .5s,filter .5s;
}
.home-box:hover img{
  transform:scale(1.05);
  filter:grayscale(60%);
}
.home-box::after{
  content:'';position:absolute;inset:0;
  background:rgba(0,0,0,.35);
  transition:background .4s;
}
.home-box:hover::after{background:rgba(0,0,0,.2)}
.home-box-title{
  position:relative;z-index:2;
  font-family:var(--font);
  font-size:clamp(1rem,2.5vw,1.6rem);
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--white);
  text-align:center;
  padding:1rem;
}

/* Placeholder if no image */
.home-box-placeholder{
  position:absolute;inset:0;
  background:linear-gradient(135deg,#444,#555);
}

/* ═══════════ FOOTER ═══════════ */

/* Social icons row above footer */
.footer-social-row{
  background:var(--dark);
  padding:2.5rem 3rem;
  display:flex;
  justify-content:center;
  gap:1.5rem;
}
.footer-social-row a{
  color:var(--white-70);
  display:flex;align-items:center;
  transition:color .3s;
}
.footer-social-row a:hover{color:var(--white)}
.footer-social-row svg{width:28px;height:28px;fill:currentColor}

.site-footer{
  background:#465981;
  padding:2rem 3rem 1.5rem;
}
.footer-info{
  font-size:.78rem;
  font-weight:500;
  color:var(--white-70);
  line-height:1.8;
}
.footer-info a{text-decoration:underline;text-underline-offset:3px}
.footer-info a:hover{color:var(--white)}
.footer-credit{color:var(--gold)}
.footer-links{
  margin-top:.5rem;
  font-size:.78rem;font-weight:600;
  color:var(--white-70);
}
.footer-links a{color:var(--white-70)}
.footer-links a:hover{color:var(--white)}

/* ═══════════ INTERNAL PAGES ═══════════ */

/* Page title banner (dark strip) */
.page-banner{
  background:var(--dark);
  padding:3rem 3rem 2.5rem;
  text-align:right;
}
.page-banner h1{
  font-family:var(--font-serif);
  font-size:clamp(2rem,4vw,3rem);
  font-weight:400;
  font-style:italic;
  color:var(--white);
  letter-spacing:.02em;
}

/* White content area */
.page-content{
  background:var(--white);
  color:var(--text-body);
  padding:3.5rem 3rem 5rem;
}
.page-content-inner{
  max-width:1100px;
  margin:0 auto;
}

/* Default text styling on white bg */
.page-content p{margin-bottom:1.5rem;line-height:1.8}
.page-content strong{color:var(--text-dark);font-weight:700}
.page-content h2{
  font-family:var(--font);
  font-size:1.4rem;font-weight:700;
  color:var(--text-dark);
  margin:2.5rem 0 1rem;
}
.page-content h3{
  font-family:var(--font);
  font-size:1.15rem;font-weight:700;
  color:var(--text-dark);
  margin:2rem 0 .8rem;
}
.page-content a{color:var(--gold);text-decoration:underline}
.page-content a:hover{color:#c9a020}
.page-content blockquote{
  border-left:3px solid var(--gold);
  padding-left:1.5rem;
  margin:2rem 0;
  font-style:italic;
  color:var(--text-dark);
}
.page-content img{border-radius:0;margin:1.5rem 0}

/* Two-column layout for profile-style pages */
.two-col{
  display:grid;
  grid-template-columns:1fr 1.5fr;
  gap:3rem;
  align-items:start;
}
.two-col img{width:100%;border-radius:0}

/* ═══════════ ELEMENTOR ON WHITE BG ═══════════ */
body.page:not(.home) .elementor-page-content{
  background:var(--white);
  color:var(--text-body);
}
body.page:not(.home) .elementor-page-content .elementor-section{
  background-color:transparent !important;
}
body.page:not(.home) .elementor-page-content p,
body.page:not(.home) .elementor-page-content li,
body.page:not(.home) .elementor-page-content span{
  color:var(--text-body);
}
body.page:not(.home) .elementor-page-content h1,
body.page:not(.home) .elementor-page-content h2,
body.page:not(.home) .elementor-page-content h3{
  color:var(--text-dark) ;
}

/* Homepage Elementor: dark bg */
body.home .elementor-page-content{
  background:var(--dark);
}

/* Global Elementor font override */
body .elementor *{font-family:var(--font) !important}
body .elementor p,body .elementor li{font-weight:500 !important}

/* ═══════════ BLOG (on white bg) ═══════════ */
.blog-wrap{
  background:var(--white);
  padding:3rem 3rem 5rem;
}
.posts-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1.5rem;
  max-width:1200px;
  margin:0 auto;
}
.post-card{
  border:1px solid #e5e5e5;
  overflow:hidden;
  transition:box-shadow .3s,transform .3s;
  display:block;
  color:var(--text-body);
}
.post-card:hover{box-shadow:0 4px 20px rgba(0,0,0,.08);transform:translateY(-3px)}
.post-card-thumb{aspect-ratio:16/10;overflow:hidden;background:#f5f5f5}
.post-card-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.post-card:hover .post-card-thumb img{transform:scale(1.04)}
.post-card-body{padding:1.2rem}
.post-card-date{font-size:.65rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:#999;margin-bottom:.5rem}
.post-card-title{font-size:1rem;font-weight:700;color:var(--text-dark);margin-bottom:.5rem;line-height:1.4}
.post-card-excerpt{font-size:.82rem;line-height:1.6;color:#888}

/* Single post */
.single-wrap{
  background:var(--white);
  padding:3rem 3rem 5rem;
}
.single-inner{
  max-width:780px;
  margin:0 auto;
  color:var(--text-body);
}
.single-inner .entry-meta{font-size:.7rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#999;margin-bottom:2rem}
.single-inner .entry-content{line-height:1.9}
.single-inner .entry-content p{margin-bottom:1.5rem}
.single-inner .entry-content h2{font-size:1.4rem;font-weight:700;color:var(--text-dark);margin:2.5rem 0 1rem}
.single-inner .entry-content h3{font-size:1.15rem;font-weight:700;color:var(--text-dark);margin:2rem 0 .8rem}
.back-link{display:inline-block;font-size:.72rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--gold);margin-top:2.5rem;padding-top:1.5rem;border-top:1px solid #e5e5e5}

/* Pagination */
.pagination{display:flex;justify-content:center;gap:.4rem;margin-top:2.5rem}
.pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;font-size:.75rem;border:1px solid #ddd;color:#888;transition:all .3s}
.pagination .page-numbers.current,.pagination .page-numbers:hover{border-color:var(--gold);color:var(--gold)}

/* ═══════════ WP ADMIN BAR ═══════════ */
.admin-bar .site-header{top:32px}
@media(max-width:782px){.admin-bar .site-header{top:46px}}

/* ═══════════ RESPONSIVE ═══════════ */
@media(max-width:1100px){
  .desktop-nav{gap:1.2rem}
  .desktop-nav a{font-size:.65rem}
}
@media(max-width:960px){
  .desktop-nav{display:none}
  .hamburger{display:block}
  .header-inner{padding:.8rem 1.5rem;justify-content:space-between}
  .site-logo{font-size:1rem;overflow:hidden;text-overflow:ellipsis}
  .hamburger{margin-left:auto;flex-shrink:0}
  .lang-switch{margin-left:auto;margin-right:.5rem}

  .hero{flex-direction:column;min-height:auto}
  .hero-photo{width:100%;aspect-ratio:3/4;max-height:70vh}
  .hero-content{
    width:100%;
    position:absolute;bottom:0;left:0;right:0;
    background:linear-gradient(to top,rgba(51,51,51,.9) 60%,transparent);
    padding:3rem 2rem 2rem;
  }
  .hero-chevron{display:none}

  .home-boxes{grid-template-columns:1fr}
  .home-box{aspect-ratio:16/9}

  .two-col{grid-template-columns:1fr;gap:2rem}
  .posts-grid{grid-template-columns:1fr}

  .top-bar{padding:.4rem 1.5rem}
  .page-banner{padding:2rem 1.5rem 1.5rem}
  .page-content{padding:2rem 1.5rem 3rem}
  .blog-wrap{padding:2rem 1.5rem 3rem}
  .single-wrap{padding:2rem 1.5rem 3rem}
}
@media(max-width:600px){
  .top-bar svg{width:15px;height:15px}
  .top-bar{gap:.8rem}
  .site-logo{font-size:.85rem}
  .header-inner{padding:.8rem 1rem}
  .posts-grid{grid-template-columns:1fr}
  .site-footer{padding:1.5rem 1.5rem;padding-bottom:calc(2rem + env(safe-area-inset-bottom, 34px));word-break:break-word}
  .footer-info{font-size:.7rem}
  .footer-links{font-size:.7rem}
  .footer-social-row{padding:2rem 1.5rem;flex-wrap:wrap}
}

/* ═══════════ WP ALIGNMENTS ═══════════ */
.aligncenter{text-align:center}
.alignleft{float:left;margin-right:1.5rem}
.alignright{float:right;margin-left:1.5rem}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
}

.menu li {
  position: relative;
}

.menu li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #4f6288;
  padding: 15px 0;
  list-style: none;
  min-width: 180px;
}

.menu li ul li {
  display: block;
}

.menu li ul li a {
  display: block;
  padding: 8px 18px;
}

.menu li:hover > ul {
  display: block;
}

/* Fix: mobile menu must be vertical */
.mobile-menu .menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}