/*
Theme Name: Rivoira Frutta
Theme URI: https://rivoirafrutta.com
Author: Akrom Media
Description: Tema su misura per Rivoira Frutta.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: rivoira-frutta
*/

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --green: #00843d;
  --green-dark: #0b3d22;
  --yellow: #ffd100;
  --ink: #14201a;
  --paper: #ffffff;
  --sand: #f4f1e8;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 94px; }
body { margin: 0; font-family: var(--font); font-weight: 400; color: var(--ink); background: var(--paper); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 700; line-height: 1.02; }
h1 { font-size: clamp(44px, 9.5vw, 148px); }
h2 { font-size: clamp(36px, 5vw, 72px); }
h3 { font-weight: 500; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--yellow); padding: 10px 14px; z-index: 20; }

/* Header */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: clamp(36px, 5vw, 84px); padding: 26px var(--pad); color: #fff; transition: background-color .3s ease, padding .3s ease; }
.header.scrolled, .header.menu-open { background: var(--paper); color: var(--ink); }
.header.scrolled { padding-top: 17px; padding-bottom: 17px; }
.logo { grid-column: 2; display: block; }
.logo img { height: clamp(64px, 6vw, 84px); width: auto; transition: height .3s ease; }
.header.scrolled .logo img { height: 52px; }
.nav { display: flex; align-items: center; gap: clamp(36px, 5vw, 84px); }
.nav-left { grid-column: 1; grid-row: 1; justify-content: flex-end; }
.nav-right { grid-column: 3; grid-row: 1; justify-content: flex-start; }
.nav a { position: relative; text-decoration: none; font-weight: 600; font-size: 18px; text-transform: uppercase; letter-spacing: .08em; padding: 10px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.menu-toggle { display: none; grid-column: 3; grid-row: 1; justify-self: end; color: inherit; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-toggle span { display: block; width: 30px; height: 3px; background: currentColor; margin: 7px 0; transition: transform .25s ease; }
.header.menu-open .menu-toggle span:first-child { transform: translateY(5px) rotate(45deg); }
.header.menu-open .menu-toggle span:last-child { transform: translateY(-5px) rotate(-45deg); }
.btn { display: inline-block; font-family: inherit; font-weight: 700; font-size: 17px; text-decoration: none; padding: 16px 28px; border: 0; border-radius: 4px; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink); }

/* Hero */
.hero { position: relative; height: 100svh; min-height: 620px; max-height: 1200px; background: var(--green-dark); overflow: hidden; display: flex; align-items: flex-end; }
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.58) saturate(1.05); }
.hero::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: clamp(200px, 32vh, 320px); background: linear-gradient(to bottom, rgba(6, 22, 13, .82), rgba(6, 22, 13, .45) 45%, rgba(6, 22, 13, 0)); pointer-events: none; }
.hero-copy { position: relative; color: #fff; padding: 0 var(--pad) clamp(110px, 16vh, 190px); max-width: 1300px; }
.hero-copy p { font-size: clamp(19px, 1.9vw, 27px); line-height: 1.4; max-width: 30em; margin-top: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 40px; }
.link-arrow { color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; }
.link-arrow::after { content: "\2192"; display: inline-block; margin-left: 10px; transition: transform .15s ease; }
.link-arrow:hover::after { transform: translateX(6px); }
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(50px, 9vw, 130px); }

/* Sections */
.section { padding: clamp(72px, 10vw, 150px) var(--pad); }
.section-head { margin-bottom: clamp(36px, 5vw, 72px); }

.strengths { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 36px); }
.strength { position: relative; overflow: hidden; border-radius: 4px; background: var(--green-dark); }
.strength img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.strength::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(to top, rgba(6, 22, 13, .88), rgba(6, 22, 13, .5) 45%, rgba(6, 22, 13, 0)); pointer-events: none; }
.strength h3 { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: clamp(18px, 2.2vw, 32px); color: #fff; }

.company { background: var(--sand); display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 100px); align-items: center; }
.company img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.company p { font-size: clamp(19px, 1.6vw, 24px); margin: 28px 0 36px; max-width: 26em; }

.contact { background: var(--green); color: #fff; display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 100px); align-items: stretch; }
.contact-info { display: flex; flex-direction: column; }
.contact dl { margin: clamp(32px, 4vw, 56px) 0 0; display: grid; gap: clamp(20px, 2.2vw, 30px); }
.contact dt { font-weight: 700; font-size: 17px; color: var(--yellow); }
.contact dd { margin: 4px 0 0; font-size: clamp(19px, 1.6vw, 24px); }
.contact dd.big { font-weight: 700; font-size: clamp(26px, 3.1vw, 46px); line-height: 1.15; overflow-wrap: anywhere; }
.contact dd a { text-decoration: none; }
.contact dd a:hover { color: var(--yellow); }
.contact .btn { margin-top: clamp(32px, 4vw, 56px); align-self: flex-start; }
.contact-map { position: relative; min-height: clamp(320px, 38vw, 560px); border-radius: 4px; overflow: hidden; background: var(--green-dark); }
.contact-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.gallery { background: var(--green-dark); padding: clamp(40px, 6vw, 88px) 0 0; overflow: hidden; display: grid; gap: clamp(10px, 1.2vw, 18px); }
.gallery-track { display: flex; gap: clamp(10px, 1.2vw, 18px); width: max-content; animation: drift 80s linear infinite; }
.gallery-track + .gallery-track { animation-direction: reverse; }
.gallery:hover .gallery-track { animation-play-state: paused; }
.gallery img { height: clamp(150px, 18vw, 280px); width: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; flex: none; }
@keyframes drift { to { transform: translateX(calc(-50% - clamp(5px, .6vw, 9px))); } }

.footer { background: var(--green-dark); color: #fff; padding: clamp(56px, 7vw, 104px) var(--pad) 28px; font-size: 16px; line-height: 1.6; }
.footer-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.footer-logo img { height: 104px; width: auto; }
.footer h2 { font-size: 16px; font-weight: 700; line-height: 1.6; color: var(--yellow); margin-bottom: 12px; }
.footer address { font-style: normal; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--yellow); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; margin-top: clamp(48px, 6vw, 80px); padding-top: 24px; border-top: 1px solid #2b5a3f; font-size: 14px; color: #c5d3ca; }

@media (max-width: 860px) {
  .header { padding: 14px var(--pad); }
  .logo img, .header.scrolled .logo img { height: 52px; }
  .menu-toggle { display: block; }
  .nav { display: none; }
  .header.menu-open { height: 100svh; align-content: start; row-gap: 0; }
  .header.menu-open .nav { display: flex; grid-column: 1 / -1; flex-direction: column; align-items: center; gap: 0; }
  .header.menu-open .nav-left { grid-row: 2; padding-top: 48px; }
  .header.menu-open .nav-right { grid-row: 3; }
  .nav a { font-size: 26px; font-weight: 700; padding: 14px 0; }
  .strengths, .company, .contact { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-logo { grid-column: 1 / -1; }
  .footer-logo img { height: 84px; }
  .strength img { aspect-ratio: 16 / 11; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .link-arrow::after, .header, .logo img, .nav a::after, .menu-toggle span { transition: none; }
  .gallery { overflow-x: auto; }
  .gallery-track { animation: none; padding: 0 var(--pad); }
}

/* Logged-in admin bar */
.admin-bar .header { top: 32px; }
@media (max-width: 782px) { .admin-bar .header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .header.scrolled { top: 0; } }

/* Inner page hero */
.page-hero { position: relative; min-height: clamp(380px, 58vh, 640px); background: var(--green-dark); overflow: hidden; display: flex; align-items: flex-end; color: #fff; }
.page-hero::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: clamp(200px, 32vh, 320px); background: linear-gradient(to bottom, rgba(6, 22, 13, .82), rgba(6, 22, 13, .45) 45%, rgba(6, 22, 13, 0)); pointer-events: none; }
.page-hero .hero-copy { z-index: 1; padding-bottom: clamp(90px, 12vw, 170px); }
.page-hero h1 { font-size: clamp(44px, 7.5vw, 112px); }
.page-hero-plain { min-height: clamp(300px, 36vh, 420px); }
.page-hero-plain::after { display: none; }
.page-hero-plain h1 { font-size: clamp(38px, 5.5vw, 80px); }

/* Azienda */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 100px); align-items: start; }
.about .lead { font-weight: 600; font-size: clamp(26px, 3vw, 44px); line-height: 1.15; }
.about .body { font-size: clamp(19px, 1.5vw, 22px); }
.about-photos { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(10px, 1.2vw, 18px); padding: 0 var(--pad) clamp(72px, 10vw, 150px); }
.about-photos img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; }
.cta { background: var(--sand); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }

/* Prodotti */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 36px); }
.product .strength { display: block; }
.product .link-arrow { display: inline-block; margin-top: 18px; color: var(--green); }

/* Contatti */
.contact-page { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 100px); align-items: start; }
.contact-page dl { margin: clamp(28px, 3vw, 44px) 0 0; display: grid; gap: clamp(18px, 2vw, 26px); }
.contact-page dt { font-weight: 700; font-size: 17px; color: var(--green); }
.contact-page dd { margin: 4px 0 0; font-size: clamp(19px, 1.6vw, 24px); }
.contact-page dd a { text-decoration: none; }
.contact-page dd a:hover { color: var(--green); }
.form-note { font-size: clamp(19px, 1.5vw, 22px); margin: 14px 0 32px; }
.rf-form .wpforms-container { margin: 0; }
.rf-form .wpforms-form .wpforms-field { padding: 0 0 16px; }
.rf-form .wpforms-form input[type=text],
.rf-form .wpforms-form input[type=email],
.rf-form .wpforms-form input[type=tel],
.rf-form .wpforms-form input[type=number],
.rf-form .wpforms-form textarea { display: block; width: 100%; max-width: 100%; height: auto; font-family: inherit; font-size: 18px; line-height: 1.4; padding: 15px 16px; border: 1px solid #b6c0b9; border-radius: 4px; background: #fff; color: var(--ink); box-shadow: none; -webkit-appearance: none; appearance: none; }
.rf-form .wpforms-form textarea { min-height: 170px; resize: vertical; }
.rf-form .wpforms-form input:focus,
.rf-form .wpforms-form textarea:focus { border-color: var(--green); outline: 2px solid var(--green); outline-offset: 0; }
.rf-form .wpforms-form .wpforms-field-label { display: block; font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.rf-form .wpforms-form .wpforms-label-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rf-form .wpforms-form ul { list-style: none; margin: 0; padding: 0; }
.rf-form .wpforms-form li { display: flex; align-items: flex-start; gap: 12px; }
.rf-form .wpforms-form input[type=checkbox] { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green); }
.rf-form .wpforms-form .wpforms-field-label-inline { font-size: 16px; line-height: 1.5; }
.rf-form .wpforms-form .wpforms-field-label-inline a { color: var(--green); text-decoration: underline; }
.rf-form .wpforms-form .wpforms-recaptcha-container { padding: 4px 0 20px; max-width: 100%; overflow: hidden; }
.rf-form .wpforms-form label.wpforms-error, .rf-form .wpforms-form em.wpforms-error { display: block; color: #b3261e; font-size: 14px; font-style: normal; margin-top: 6px; }
.rf-form .wpforms-form button[type=submit] { font-family: inherit; font-weight: 700; font-size: 17px; line-height: 1.2; height: auto; padding: 17px 36px; border: 0; border-radius: 4px; background: var(--green); color: #fff; cursor: pointer; -webkit-appearance: none; appearance: none; }
.rf-form .wpforms-form button[type=submit]:hover { background: var(--green-dark); }
.rf-form .wpforms-confirmation-container, .rf-form .wpforms-confirmation-container-full { padding: 20px 22px; border-radius: 4px; background: var(--sand); font-size: 18px; }

/* Map, loaded only on request */
.contact-map.is-idle { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 14px; padding: clamp(20px, 3vw, 40px); color: #fff; }
.contact-map.is-idle > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.45); }
.contact-map.is-idle > * { position: relative; }
.contact-map p { font-size: 15px; line-height: 1.5; max-width: 34em; }
.map-band { padding: 0 var(--pad) clamp(72px, 10vw, 150px); }
.map-band .contact-map { min-height: clamp(320px, 40vw, 520px); }

/* Policy and generic pages */
.prose { max-width: 860px; font-size: 18px; line-height: 1.65; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; margin-top: 2.2em; }
.prose h3 { font-weight: 700; font-size: 20px; line-height: 1.3; margin-top: 1.8em; }
.prose a { color: var(--green); text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose .table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid #d5dbd6; }
.prose th { font-weight: 700; }
.prose td:first-child { min-width: 8em; }
.prose .updated { color: #55635a; font-size: 16px; }

/* Footer legal links */
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.footer-legal a { text-decoration: none; }

@media (max-width: 860px) {
  .about, .about-photos, .products, .contact-page { grid-template-columns: 1fr; }
  .products { gap: 36px; }
  .product .strength img { aspect-ratio: 16 / 11; }
  .product .link-arrow { margin-top: 8px; padding: 10px 0; }
  .hero-actions .link-arrow { padding: 12px 0; }
  .contact dd a, .contact-page dd a { display: inline-block; padding: 6px 0; }
  .footer ul { gap: 0; }
  .footer li a { display: inline-block; padding: 9px 0; }
  .footer-legal { gap: 0 28px; }
  .footer-legal a { display: inline-block; padding: 11px 0; }
  .contact-map p a { display: inline-block; padding: 8px 0; }
}
@media (max-width: 700px) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { display: none; }
  .prose tr { padding: 14px 0; border-bottom: 1px solid #d5dbd6; }
  .prose td { border: 0; padding: 2px 0; }
  .prose td:first-child { font-weight: 700; min-width: 0; }
}
