/*
Theme Name: Celletta
Theme URI: https://www.celletta.com
Author: Andrea Forasassi
Description: Tema su misura per l'Appartamento della Celletta, Santarcangelo di Romagna. Bilingue con Polylang, calendario disponibilità da Airbnb (iCal).
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: celletta
*/

@font-face { font-family: "Cormorant"; src: url(assets/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(assets/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(assets/fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
	--c-bg: #faf7f2;
	--c-paper: #ffffff;
	--c-ink: #2a231e;
	--c-muted: #6e645b;
	--c-line: #e8e0d5;
	--c-accent: #9c4f2c;
	--c-accent-dark: #763a1f;
	--c-sand: #f1e9de;
	--c-busy: #ead8cd;
	--c-free: #edf2e8;
	--f-serif: "Cormorant", "Iowan Old Style", Georgia, serif;
	--f-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--w: 1160px;
	--radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); font-family: var(--f-sans); font-size: 1.0625rem; line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-underline-offset: 3px; }
a:hover { color: var(--c-accent-dark); }
h1, h2, h3 { font-family: var(--f-serif); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.005em; color: var(--c-ink); }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h3 { font-size: 1.55rem; }
p { margin: 0 0 1.1em; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; clip: auto; width: auto; height: auto; background: #fff; padding: 8px 12px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; }
.eyebrow { font-family: var(--f-sans); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--c-muted); margin-bottom: .8em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250,247,242,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-line); transition: background .3s, border-color .3s; }
.admin-bar .site-header { top: 32px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--c-ink); }
.brand img { height: 42px; width: auto; }
.brand .brand-name { font-family: var(--f-serif); font-size: 1.45rem; font-weight: 600; line-height: 1; display: block; }
.brand small { display: block; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--c-muted); margin-top: 4px; }
.brand .logo-light { display: none; }
.site-header.over-hero { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; backdrop-filter: none; }
.site-header.over-hero .brand, .site-header.over-hero .brand small, .site-header.over-hero .main-nav a, .site-header.over-hero .lang-switch a, .site-header.over-hero .lang-switch span { color: #fff; }
.site-header.over-hero .brand .logo-dark { display: none; }
.site-header.over-hero .brand .logo-light { display: block; }
.site-header.over-hero .main-nav a:hover { background: rgba(255,255,255,.14); }
.site-header.over-hero.scrolled { background: rgba(250,247,242,.96); border-color: var(--c-line); backdrop-filter: blur(8px); }
.site-header.over-hero.scrolled .brand, .site-header.over-hero.scrolled .main-nav a, .site-header.over-hero.scrolled .lang-switch span { color: var(--c-ink); }
.site-header.over-hero.scrolled .brand small, .site-header.over-hero.scrolled .lang-switch a { color: var(--c-muted); }
.site-header.over-hero.scrolled .brand .logo-dark { display: block; }
.site-header.over-hero.scrolled .brand .logo-light { display: none; }
.site-header.over-hero.scrolled .main-nav .nav-cta a { color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 8px 16px; font: inherit; font-size: .9rem; color: inherit; cursor: pointer; }
.over-hero:not(.scrolled) .nav-toggle { color: #fff; }
.main-nav { display: flex; align-items: center; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav a { display: block; padding: 8px 14px; color: var(--c-ink); text-decoration: none; border-radius: 999px; font-size: .95rem; }
.main-nav a:hover { background: var(--c-sand); }
.main-nav .current a { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.main-nav .nav-cta a { background: var(--c-accent); color: #fff; margin-left: 6px; }
.main-nav .nav-cta a:hover { background: var(--c-accent-dark); }
.lang-switch { display: flex; gap: 2px; margin-left: 10px; }
.lang-switch a, .lang-switch span { padding: 6px 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; color: var(--c-muted); }
.lang-switch .current-lang { color: var(--c-ink); font-weight: 600; }
@media (max-width: 960px) {
	.nav-toggle { display: inline-block; }
	.main-nav { display: none; flex-direction: column; align-items: stretch; position: absolute; left: 0; right: 0; top: 100%; background: var(--c-bg); border-bottom: 1px solid var(--c-line); padding: 8px 24px 18px; }
	.main-nav.open { display: flex; }
	.site-header.over-hero .main-nav a, .site-header.over-hero .lang-switch span { color: var(--c-ink); }
	.site-header.over-hero .lang-switch a { color: var(--c-muted); }
	.site-header.over-hero .main-nav .nav-cta a { color: #fff; }
	.main-nav ul { flex-direction: column; align-items: stretch; }
	.main-nav a { padding: 13px 14px; font-size: 1.05rem; }
	.main-nav .nav-cta a { margin: 6px 0 0; text-align: center; }
	.lang-switch { margin: 10px 0 0; }
	.brand .brand-name { font-size: 1.2rem; }
	.brand img { height: 34px; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 560px) { .brand small { display: none; } .brand .brand-name { font-size: 1.12rem; white-space: nowrap; } .brand img { height: 30px; } .brand { gap: 8px; } .nav-toggle { padding: 7px 13px; } }

/* Home hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; color: #fff; background: #3a2e27 center/cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,14,10,.5) 0%, rgba(20,14,10,0) 22%), linear-gradient(90deg, rgba(20,14,10,.72) 0%, rgba(20,14,10,.4) 45%, rgba(20,14,10,.05) 80%), linear-gradient(0deg, rgba(20,14,10,.55) 0%, rgba(20,14,10,0) 45%); }
@media (max-width: 700px) { .hero { background-position: 60% center; } .hero::after { background: linear-gradient(180deg, rgba(20,14,10,.55) 0%, rgba(20,14,10,.2) 30%, rgba(20,14,10,.78) 75%); } }
.hero .wrap { position: relative; z-index: 1; padding-top: 120px; padding-bottom: clamp(48px, 9vh, 96px); width: 100%; }
.hero .eyebrow { color: rgba(255,255,255,.85); }
.hero h1 { color: #fff; max-width: 820px; margin-bottom: .35em; text-shadow: 0 2px 24px rgba(0,0,0,.3); }
.hero p.hero-sub { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 600px; color: rgba(255,255,255,.92); }
.hero-scroll { position: absolute; z-index: 1; left: 50%; bottom: 18px; transform: translateX(-50%); color: rgba(255,255,255,.8); font-size: 1.4rem; text-decoration: none; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .hero-scroll { animation: none; } }
.page-banner { height: clamp(220px, 36vw, 440px); background: #3a2e27 center/cover no-repeat; }

/* Intro strip */
.intro { padding: clamp(56px, 9vw, 110px) 0 20px; text-align: center; }
.intro h2 { max-width: 780px; margin: 0 auto .4em; }
.intro p { max-width: 640px; margin: 0 auto; color: var(--c-muted); font-size: 1.1rem; }
.facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 34px; margin: 34px auto 0; padding: 0; list-style: none; font-size: .95rem; color: var(--c-muted); }
.facts strong { display: block; font-family: var(--f-serif); font-size: 2rem; font-weight: 500; color: var(--c-ink); line-height: 1.1; }

/* Buttons */
.btn, .wp-block-button__link { display: inline-block; padding: 14px 26px; border-radius: 999px; background: var(--c-accent); color: #fff !important; text-decoration: none; font-weight: 600; font-size: .98rem; border: 1.5px solid var(--c-accent); line-height: 1.2; transition: background .2s, color .2s; }
.btn:hover, .wp-block-button__link:hover { background: var(--c-accent-dark); border-color: var(--c-accent-dark); }
.btn-outline { background: transparent; color: var(--c-accent) !important; }
.btn-outline:hover { background: var(--c-accent); color: #fff !important; }
.btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.75); backdrop-filter: blur(4px); }
.btn-ghost:hover { background: #fff; color: var(--c-ink) !important; border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px auto; }
.wp-block-buttons .wp-block-button + .wp-block-button .wp-block-button__link { background: transparent; color: var(--c-accent) !important; }
.wp-block-buttons .wp-block-button + .wp-block-button .wp-block-button__link:hover { background: var(--c-accent); color: #fff !important; }

/* Content */
.site-main { padding: 0 0 80px; }
.entry { padding-top: 56px; }
.entry-title { margin-bottom: .6em; }
.entry-content > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.entry-content > .alignwide, .entry-content > .wp-block-columns, .entry-content > .wp-block-gallery, .entry-content > .celletta-cal, .entry-content > .book-options, .entry-content > .wp-block-group.is-wide { max-width: var(--w); }
.entry-content > .alignfull { max-width: none; }
.entry-content h2 { margin-top: 1.5em; }
.entry-content ul { padding-left: 1.2em; }
.entry-content li { margin-bottom: .3em; }
.lead { font-family: var(--f-serif); font-size: clamp(1.35rem, 2.4vw, 1.65rem); line-height: 1.45; color: var(--c-ink); }
.home-entry { padding-top: 10px; }

.wp-block-columns { display: flex; flex-wrap: wrap; gap: 24px; margin: 40px auto; }
.wp-block-column { flex: 1 1 260px; min-width: 0; }
.wp-block-image { margin: 36px auto; }
.wp-block-image img { border-radius: var(--radius); }
.wp-block-columns .wp-block-image { margin: 0; }
.wp-block-columns .wp-block-image img { width: 100%; height: 400px; object-fit: cover; }
@media (max-width: 700px) { .wp-block-columns .wp-block-image img { height: 280px; } }
.wp-block-image figcaption, .wp-element-caption { font-size: .88rem; color: var(--c-muted); margin-top: 8px; text-align: center; }

.card { background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 28px; height: 100%; }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }

.amenities { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 28px; }
.amenities li { padding-left: 28px; position: relative; }
.amenities li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 8px; border-left: 2px solid var(--c-accent); border-bottom: 2px solid var(--c-accent); transform: rotate(-45deg); }

/* Gallery */
.wp-block-gallery, .celletta-gallery { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 36px auto; padding: 0; list-style: none; }
.wp-block-gallery figure, .celletta-gallery figure { margin: 0 !important; width: auto !important; }
.wp-block-gallery img, .celletta-gallery img { width: 100%; height: 240px; object-fit: cover; border-radius: 8px; cursor: zoom-in; transition: transform .3s; }
.wp-block-gallery img:hover { transform: scale(1.015); }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20,16,14,.95); display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; width: auto; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; font-size: 1.6rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* Map */
.map-embed { margin: 32px auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-line); }
.map-embed iframe { display: block; width: 100%; height: 400px; border: 0; }

/* Calendar */
.celletta-cal { margin: 32px auto; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.cal-nav button { background: var(--c-paper); border: 1px solid var(--c-line); border-radius: 999px; width: 44px; height: 44px; font: inherit; cursor: pointer; color: var(--c-ink); }
.cal-nav button:disabled { opacity: .35; cursor: default; }
.cal-months { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 700px) { .cal-months { grid-template-columns: 1fr; } }
.cal-month { background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 18px; }
.cal-month[hidden] { display: none; }
.cal-month h3 { text-align: center; font-size: 1.35rem; margin-bottom: 10px; text-transform: capitalize; }
.cal-month table { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.cal-month th { font-size: .72rem; color: var(--c-muted); font-weight: 600; text-transform: uppercase; padding: 4px 0; }
.cal-month td { text-align: center; padding: 9px 0; font-size: .95rem; border-radius: 6px; }
.cal-month td.free { background: var(--c-free); }
.cal-month td.busy { background: var(--c-busy); color: #8a6a5a; text-decoration: line-through; }
.cal-month td.past { color: #c8beb3; }
.cal-month td.today { outline: 2px solid var(--c-accent); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: .9rem; color: var(--c-muted); margin-top: 12px; }
.cal-legend span::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.cal-legend .l-free::before { background: var(--c-free); border: 1px solid #cfdcc6; }
.cal-legend .l-busy::before { background: var(--c-busy); }
.cal-note { font-size: .88rem; color: var(--c-muted); margin-top: 6px; }

.book-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin: 36px auto; }
.book-options .card { display: flex; flex-direction: column; }
.book-options .card .btn { margin-top: auto; align-self: flex-start; }

/* Footer */
.site-footer { background: #2a231e; color: #e6ddd2; padding: 56px 0 30px; font-size: .95rem; }
.site-footer a { color: #f0c8ad; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.site-footer h2 { color: #fff; font-size: 1.4rem; margin-bottom: .4em; }
.site-footer p { margin-bottom: .4em; }
.footer-brand img { height: 46px; width: auto; margin-bottom: 12px; opacity: .9; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 18px; font-size: .85rem; color: #b9ada2; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.cin { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
