/*
Theme Name: Tuscan Table
Theme URI: https://example.com/tuscan-table
Author: Restaurant website theme
Description: A warm, rustic Italian restaurant theme with a menu manager, reservation request form, private dining enquiries, gallery lightbox and local SEO basics. Seven designed pages, no page builder required.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tuscan-table
*/

/* ---------- Tokens ---------- */
:root {
	--cream: #F7F1E7;
	--cream-2: #EFE5D3;
	--terracotta: #C76545;
	--terracotta-dark: #A04A2E;
	--olive: #68734A;
	--espresso: #392A22;
	--gold: #C6A36A;
	--white: #FFFFFF;
	--line: rgba(57, 42, 34, .2);
	--field: #7B6A5C;
	--error: #9B2C1A;
	--serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--sans: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--italic: "Cormorant Garamond", Georgia, serif;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
	--radius: 6px;
	--header-h: 76px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
	margin: 0;
	background: var(--cream);
	color: var(--espresso);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta-dark); text-underline-offset: .2em; }
a:hover { color: var(--espresso); }
:focus-visible { outline: 3px solid var(--terracotta-dark); outline-offset: 3px; }
.section--dark :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .6em; color: var(--espresso); }
h1 { font-size: clamp(2.4rem, 6.2vw, 4.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
p { margin: 0 0 1.1em; max-width: 68ch; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--cream); }
.section--dark a { color: var(--gold); }
.section--dark a:hover { color: var(--white); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--espresso); color: var(--cream); padding: .6rem 1rem; z-index: 100; border-radius: var(--radius); }
.skip:focus { top: 1rem; color: var(--cream); }
.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tint { background: var(--cream-2); }
.section--dark { background: var(--espresso); color: var(--cream); }
.lead { font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.55; }
.italian { font-family: var(--italic); font-style: italic; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--olive); margin: 0; }
.section--dark .italian { color: var(--gold); }
.editor-note { border: 1.5px dashed var(--gold); padding: 1rem 1.25rem; border-radius: var(--radius); font-size: .95rem; max-width: 68ch; }
.rule { border: 0; border-top: 1px solid var(--gold); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: .65rem 1.6rem;
	border-radius: var(--radius); border: 2px solid transparent;
	font-family: var(--sans); font-weight: 700; font-size: 1.2rem; line-height: 1.2;
	text-decoration: none; cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: var(--terracotta-dark); color: var(--white); }
.btn-secondary { background: var(--olive); color: var(--white); }
.btn-secondary:hover { background: var(--espresso); color: var(--white); }
.btn-ghost { background: transparent; color: var(--espresso); border-color: var(--espresso); }
.btn-ghost:hover { background: var(--espresso); color: var(--cream); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn-sm { min-height: 44px; font-size: 1rem; padding: .5rem 1.1rem; background: var(--terracotta-dark); color: var(--white); }
.btn-sm:hover { background: var(--espresso); color: var(--white); }
.actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.75rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--cream); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand { margin-right: auto; text-decoration: none; color: var(--espresso); font-family: var(--serif); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.brand:hover { color: var(--terracotta-dark); }
.brand img { max-height: 52px; width: auto; }
.primary .menu { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.primary a { color: var(--espresso); text-decoration: none; padding: .4rem 0; border-bottom: 2px solid transparent; }
.primary a:hover, .primary .current-menu-item > a, .primary .current_page_item > a { border-bottom-color: var(--gold); color: var(--espresso); }
.nav-toggle { display: none; min-height: 44px; padding: .4rem .9rem; background: transparent; color: var(--espresso); border: 2px solid var(--espresso); border-radius: var(--radius); font: 700 1rem var(--sans); cursor: pointer; }
@media (max-width: 920px) {
	.nav-toggle { display: inline-flex; align-items: center; }
	.primary { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--cream); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1.25rem; }
	.primary.is-open { display: block; }
	.primary .menu { flex-direction: column; gap: 0; }
	.primary a { display: block; padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
}

/* ---------- Hero ---------- */
.hero, .page-hero { padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.hero-grid, .page-hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hero .lead, .page-hero .lead { max-width: 34ch; }
.arch { border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; aspect-ratio: 3 / 4; background: var(--cream-2); }
.arch .rt-photo, .arch .rt-ph { width: 100%; height: 100%; object-fit: cover; }
.page-hero-grid:not(:has(.arch)) { grid-template-columns: 1fr; }
.reveal { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy .lead.reveal { animation-delay: .12s; }
.hero-copy .actions.reveal { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (max-width: 800px) {
	.hero-grid, .page-hero-grid { grid-template-columns: 1fr; }
	.arch { max-width: 420px; aspect-ratio: 4 / 5; }
}

/* ---------- Photos and placeholders ---------- */
.rt-photo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.rt-ph {
	display: grid; place-items: center; text-align: center; padding: 1rem;
	min-height: 100%; width: 100%; height: 100%;
	background: var(--cream-2); color: var(--olive);
	border: 1.5px dashed var(--gold); border-radius: inherit; font-size: .95rem;
}
.section--tint .rt-ph { background: var(--cream); }
.frame { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--cream-2); }

/* ---------- Split sections ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.split--flip > :first-child { order: 2; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } .split--flip > :first-child { order: 0; } }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; margin-bottom: 2.25rem; }
.head-row h2 { margin: 0; }

/* ---------- Dishes (home) ---------- */
.dish-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.75rem; }
.dish-card h3 { font-size: 1.35rem; margin: 1rem 0 .35rem; }
.dish-card p { font-size: .98rem; margin-bottom: .4rem; }
.dish-card .price, .dish .price { font-weight: 700; white-space: nowrap; }
@media (max-width: 1000px) { .dish-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .dish-cards { grid-template-columns: 1fr; } }

/* ---------- Category list (home) ---------- */
.cat-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--gold); }
.cat-list li { border-bottom: 1px solid var(--gold); }
.cat-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.1rem 0; font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); color: var(--espresso); text-decoration: none; }
.cat-list a:hover { color: var(--terracotta-dark); padding-left: .5rem; }
.cat-list a { transition: padding .2s, color .2s; }
.cat-list small { font: 400 1rem var(--sans); color: var(--olive); }

/* ---------- Dining experience (dark) ---------- */
.experience { max-width: 46rem; }
.experience p { font-size: 1.2rem; }

/* ---------- Gallery ---------- */
.gallery-preview { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1rem; height: clamp(320px, 46vw, 560px); }
.gallery-preview > * { border-radius: var(--radius); overflow: hidden; min-height: 0; background: var(--cream-2); }
.gallery-preview > :first-child { grid-row: span 2; }
.gallery-preview .rt-photo { cursor: zoom-in; }
@media (max-width: 640px) { .gallery-preview { grid-template-columns: 1fr 1fr; grid-template-rows: auto; height: auto; } .gallery-preview > * { aspect-ratio: 1; } .gallery-preview > :first-child { grid-row: auto; grid-column: span 2; aspect-ratio: 16 / 10; } }
.rt-gallery { columns: 3 260px; column-gap: 1rem; }
.rt-gallery img, .rt-gallery .rt-ph, .wp-block-gallery img { border-radius: var(--radius); }
.rt-gallery > * { break-inside: avoid; margin: 0 0 1rem; }
.rt-gallery .rt-ph { aspect-ratio: 4 / 3; height: auto; }
.rt-gallery .rt-ph:nth-child(3n+2) { aspect-ratio: 3 / 4; }
.rt-gallery img, .wp-block-gallery img { cursor: zoom-in; }
.gallery-block { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; color: var(--cream); }
.lightbox::backdrop { background: rgba(57, 42, 34, .94); }
.lightbox-inner { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; height: 100%; padding: 4rem 1rem 1.5rem; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: .75rem; min-width: 0; }
.lightbox img { max-height: calc(100vh - 9rem); width: auto; max-width: 100%; border-radius: var(--radius); }
.lightbox figcaption { font-size: .95rem; }
.lb-btn { min-height: 48px; min-width: 48px; padding: .4rem .9rem; background: var(--cream); color: var(--espresso); border: 0; border-radius: var(--radius); font: 700 1rem var(--sans); cursor: pointer; }
.lb-btn:hover { background: var(--gold); }
.lb-close { position: absolute; top: 1rem; right: 1rem; }
@media (max-width: 640px) { .lightbox-inner { grid-template-columns: 1fr 1fr; } .lightbox figure { grid-column: 1 / -1; grid-row: 1; } }

/* ---------- Menu page ---------- */
.menu-nav { position: sticky; top: var(--header-h); z-index: 20; background: var(--cream); border-bottom: 1px solid var(--line); }
.menu-nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: .8rem 0; overflow-x: auto; white-space: nowrap; }
.menu-nav a { color: var(--espresso); text-decoration: none; font-weight: 700; padding: .3rem 0; border-bottom: 2px solid transparent; }
.menu-nav a:hover { border-bottom-color: var(--terracotta-dark); }
.menu-cat { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--gold); }
.menu-cat:last-of-type { border-bottom: 0; }
.menu-cat h2 { margin-bottom: 1.5rem; }
.dishes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem clamp(2rem, 6vw, 5rem); }
@media (max-width: 800px) { .dishes { grid-template-columns: 1fr; } }
.dish-head { display: flex; align-items: baseline; gap: .6rem; }
.dish-head h3 { margin: 0; font-size: 1.3rem; }
.leader { flex: 1; min-width: 1rem; border-bottom: 2px dotted var(--gold); transform: translateY(-.25em); }
.dish-desc { margin: .25rem 0 0; font-size: 1rem; }
.dish-diet { margin: .2rem 0 0; font-size: .9rem; color: var(--olive); font-weight: 700; }
.dish--sample { opacity: .6; }
.allergen { max-width: 46rem; }

/* ---------- Reviews, location ---------- */
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2.25rem; }
.review { margin: 0; border-left: 2px solid var(--gold); padding-left: 1.25rem; }
.review p { font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; }
.review footer { font-size: .95rem; }
.info-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.info-list li { margin-bottom: .35rem; }
.hours { list-style: none; margin: 0 0 1.5rem; padding: 0; max-width: 24rem; }
.hours li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.map-box { border-radius: var(--radius); overflow: hidden; min-height: 340px; background: var(--cream-2); }
.map-box iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }
.map-box .rt-ph { min-height: 340px; }

/* ---------- Steps, FAQ ---------- */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; max-width: 46rem; }
.steps li { counter-increment: s; padding: 1rem 0 1rem 3rem; border-bottom: 1px solid var(--gold); position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: .85rem; font: 500 1.6rem var(--serif); color: var(--terracotta-dark); }
.tags { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0 0 1.5rem; padding: 0; }
.tags li { border: 1.5px solid var(--gold); border-radius: 999px; padding: .3rem 1rem; }
.faq { max-width: 46rem; border-top: 1px solid var(--gold); }
.faq details { border-bottom: 1px solid var(--gold); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; font: 500 1.25rem var(--serif); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .9rem; font-size: 1.6rem; color: var(--terracotta-dark); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 1rem; margin: 0; }
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
.team h3 { margin-bottom: .2rem; }
.team .role { color: var(--olive); font-weight: 700; margin-bottom: .6rem; }

/* ---------- Forms ---------- */
.form-wrap { max-width: 46rem; }
.rt-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field--wide, .form-foot { grid-column: 1 / -1; }
@media (max-width: 640px) { .rt-form { grid-template-columns: 1fr; } }
.field label { font-weight: 700; }
.field .opt { font-weight: 400; color: #5b4c42; }
.field input, .field select, .field textarea {
	width: 100%; min-height: 50px; padding: .65rem .85rem;
	font: inherit; color: var(--espresso); background: var(--white);
	border: 1.5px solid var(--field); border-radius: var(--radius);
}
.field textarea { min-height: 120px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--terracotta-dark); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.field-error { margin: 0; color: var(--error); font-weight: 700; font-size: .95rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .95rem; margin: 0; }
.alert { border-left: 4px solid var(--error); background: var(--white); padding: 1rem 1.25rem; margin-bottom: 1.5rem; max-width: 46rem; }
.alert--ok { border-color: var(--olive); }
.pill-note { display: inline-block; background: var(--cream-2); border: 1.5px solid var(--gold); border-radius: var(--radius); padding: .6rem 1rem; font-weight: 700; margin-bottom: 1.5rem; }
.alt-contact { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1rem; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--cream-2); text-align: left; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cta-band h2 { margin-bottom: .25em; }
.cta-band p { margin: 0; }

/* ---------- Content (default pages) ---------- */
.entry { max-width: 46rem; }
.entry > * + * { margin-top: 1.1em; }
.entry h2, .entry h3 { margin-top: 1.6em; }
.entry ul, .entry ol { padding-left: 1.4rem; }
.alignwide { width: min(1180px, 100%); }

/* ---------- Footer ---------- */
.site-footer { background: var(--espresso); color: var(--cream); padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem; }
.site-footer a { color: var(--cream); text-decoration-color: var(--gold); }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; }
.site-footer h2 { font: 500 1.2rem var(--serif); color: var(--gold); margin-bottom: .8rem; }
.footer-brand { font: 700 1.6rem var(--serif); color: var(--cream); margin: 0 0 .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer p { font-size: .98rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(198, 163, 106, .5); display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; font-size: .9rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Gallery editor content ---------- */
.entry-gallery .wp-block-gallery { margin-bottom: 2.5rem; }
.entry-gallery h2 { margin-top: 2rem; }
