/*
Theme Name: The An Nam
Theme URI: https://annamhotel.com
Author: The An Nam
Description: Theme tối giản cho The An Nam — tông be ấm, chữ Cormorant, menu trượt bên phải, Custom Post Type "Cơ sở", block pattern cho trang phòng.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: annamhotel
*/

/* Brand palette: The An Nam — Limestone Grey (HUONG-DAN-SU-DUNG.txt). */
:root {
	--bg: #edf0f1;      /* ghi sương — page background */
	--light: #d9dcde;   /* ghi nhạt — brand background: footer, mobile bar, lines */
	--fg: #303438;      /* graphite — text, logo, dark buttons */
	--muted: #8c9398;   /* ghi phụ — dots, decorative */
	--white: #ffffff;
	--gray: #63696e;    /* ghi phụ darkened so small text passes WCAG AA on --bg */
	--accent: #63696e;
	--serif: "Cormorant", Georgia, serif;
	--sans: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 400 14px/21px var(--sans);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 400; }
p, ul, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px;
	background: var(--fg); color: var(--bg); padding: 8px 16px;
}

/* ---------- Layout ---------- */
.container { width: 100%; margin-inline: auto; }
@media (min-width: 350px)  { .container { max-width: 350px; } }
@media (min-width: 676px)  { .container { max-width: 676px; } }
@media (min-width: 790px)  { .container { max-width: 790px; } }
@media (min-width: 1200px) { .container { max-width: 1200px; } }
@media (max-width: 349px)  { .container { padding-inline: 16px; } }

.section { margin-bottom: 88px; }
@media (min-width: 1280px) { .section { margin-bottom: 100px; } }

/* ---------- Typography ---------- */
.h-section { font-family: var(--serif); font-size: 28px; line-height: 1; margin-bottom: 31.5px; }
@media (min-width: 768px)  { .h-section { font-size: 32px; line-height: 40px; } }
@media (min-width: 1280px) { .h-section { font-size: 36px; line-height: 45px; margin-bottom: 28px; } }
.h-card { font-family: var(--serif); font-size: 24px; line-height: 31px; margin-bottom: 12px; }
@media (min-width: 1280px) { .h-card { font-size: 28px; line-height: 1; } }
.text-body { font-family: var(--serif); font-size: 12px; line-height: 21.5px; }
@media (min-width: 768px) { .text-body { font-size: 14px; line-height: 24px; } }
.text-body p + p { margin-top: 12px; }
.label { font: 400 12px/22px var(--sans); color: var(--gray); text-transform: uppercase; margin: 26px 0 18px; }

/* ---------- Buttons ---------- */
.btn-dark {
	display: inline-block; background: var(--fg); color: var(--white);
	padding: 14px 72px; transition: opacity .2s;
}
.btn-dark:hover { opacity: .9; }
.btn-outline {
	display: inline-block; width: fit-content; border: 1px solid var(--fg);
	padding: 3.5px 48px; font: 400 14px/24px var(--sans); transition: background .3s;
}
.btn-outline:hover { background: var(--white); }

/* ---------- Header ---------- */
.site-header { position: relative; padding: 17.5px 35px; background: var(--bg); }
.site-header__inner { display: flex; justify-content: center; align-items: center; }
/* Header: wordmark only (THE AN NAM). Menu + footer: full stacked logo. */
.site-logo img, .custom-logo { width: 150px; height: auto; }
@media (min-width: 768px)  { .site-logo img, .custom-logo { width: 180px; } }
@media (min-width: 1280px) { .site-logo img, .custom-logo { width: 210px; } }
.site-logo--full img { width: 120px; }
.site-footer__logo .site-logo--full img { width: 140px; }
.site-header__actions {
	position: absolute; right: 10.5px; top: 50%; transform: translateY(-50%);
	display: flex; align-items: center; gap: 28px;
}
.site-header__actions .btn-dark { display: none; }
@media (min-width: 768px) { .site-header__actions .btn-dark { display: block; } }
.menu-toggle svg { width: 28px; height: 28px; display: block; }

.mobile-booking {
	position: fixed; inset: auto 0 0 0; z-index: 40; background: var(--light);
	padding: 10.5px 16px; display: flex;
}
.mobile-booking .btn-dark { width: 100%; text-align: center; padding-inline: 0; }
@media (min-width: 768px) { .mobile-booking { display: none; } }

/* ---------- Off-canvas menu ---------- */
.offcanvas {
	position: fixed; top: 0; right: 0; z-index: 60; height: 100%; width: 100%;
	display: flex; flex-direction: column; background: var(--bg);
	padding: 42px 21px; transform: translateX(100%); transition: transform .3s ease-in-out, visibility .3s;
	visibility: hidden;
}
@media (min-width: 768px)  { .offcanvas { padding: 48px 39px; } }
@media (min-width: 1024px) { .offcanvas { width: 390px; } }
.offcanvas.is-open { transform: none; visibility: visible; }
.offcanvas__top { display: flex; justify-content: space-between; align-items: center; }
.offcanvas nav { margin-top: 88px; flex-grow: 1; }
.offcanvas nav ul { list-style: none; padding: 0; margin: 0; }
.offcanvas nav li { display: flex; flex-direction: column; gap: 26px; }
.offcanvas nav li + li { margin-top: 26px; }
.offcanvas nav li:not(:last-child)::after {
	content: ""; height: 1px; width: 100%; background: var(--light);
}
@media (min-width: 1024px) { .offcanvas nav li:not(:last-child)::after { width: 48px; } }
.offcanvas nav a { font-family: var(--serif); font-size: 28px; line-height: 1; transition: color .2s; }
.offcanvas nav a:hover, .offcanvas nav .current-menu-item > a { color: var(--accent); }
.offcanvas nav .sub-menu { display: none; }
.offcanvas > .btn-dark { margin-top: auto; margin-left: auto; width: fit-content; }
.backdrop {
	position: fixed; inset: 0; z-index: 55; background: rgba(48, 52, 56, .35);
	opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.backdrop.is-open { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }

/* ---------- Front page ---------- */
.hero { position: relative; margin-bottom: 54px; }
@media (min-width: 768px) {
	.hero { width: 100%; margin-inline: auto; max-width: 676px; }
}
@media (min-width: 790px)  { .hero { max-width: 790px; } }
@media (min-width: 1200px) { .hero { max-width: 1200px; } }
.hero video, .hero img { width: 100%; object-fit: cover; }
.hero__sound {
	position: absolute; right: 16px; bottom: 16px; padding: 8px; border-radius: 50%;
	background: rgba(0, 0, 0, .5); color: #fff; opacity: 0; transition: opacity .3s;
}
.hero:hover .hero__sound, .hero__sound:focus-visible { opacity: 1; }
.hero__sound svg { width: 24px; height: 24px; display: block; }
.placeholder { background: var(--light); aspect-ratio: 16 / 9; width: 100%; }

.intro { display: flex; flex-direction: column; align-items: center; text-align: center; }
.intro__title { font-family: var(--serif); font-size: 24px; line-height: 31px; margin-bottom: 24px; }
@media (min-width: 768px)  { .intro__title { margin-bottom: 17.5px; } }
@media (min-width: 1280px) { .intro__title { font-size: 32px; line-height: 40px; margin-bottom: 28px; } }
.intro .text-body { max-width: 319px; }
@media (min-width: 768px) { .intro .text-body { max-width: 535px; } }

.h-scroll { overflow-x: auto; padding-bottom: 21px; margin-inline: -14px; padding-inline: 14px; scrollbar-width: thin; }
.h-scroll__track { display: flex; gap: 21px; width: max-content; }
.card-property { width: 340px; flex-shrink: 0; }
.card-property__img img, .card-property__img .placeholder {
	width: 100%; height: 300px; object-fit: cover; aspect-ratio: auto;
}
@media (min-width: 768px) { .card-property__img img, .card-property__img .placeholder { height: 400px; } }
.card-property .text-body { margin-bottom: 18px; }
.h-card a:hover { color: var(--accent); }

.story__row { display: flex; flex-direction: column; }
@media (min-width: 768px) { .story__row { flex-direction: row; } .story__media, .story__content { flex: 0 0 50%; } }
@media (min-width: 1280px) { .story__media { flex-basis: 66.666%; } .story__content { flex-basis: 33.333%; } }
.story__media img { width: 100%; height: 100%; object-fit: cover; }
.story__content { display: flex; flex-direction: column; padding: 24px 0; }
@media (min-width: 768px)  { .story__content { padding: 35px; } }
@media (min-width: 1280px) { .story__content { padding: 35px 31.5px; } }
.story__content .text-body { flex-grow: 1; margin-bottom: 21px; }

.cta { position: relative; overflow: hidden; height: 350px; background: var(--fg); }
@media (min-width: 768px)  { .cta { height: 380px; } }
@media (min-width: 1280px) { .cta { height: 480px; } }
.cta > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta__box { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 90%; }
.cta__title {
	font-family: var(--serif); font-size: 24px; line-height: 31px; color: #fff;
	text-align: center; margin-bottom: 28px;
}
@media (min-width: 1280px) { .cta__title { font-size: 28px; line-height: 1; } }
.cta__btn {
	display: block; text-align: center; padding: 14px 0; background: var(--bg);
	font-size: 12px; line-height: 21.5px;
}
@media (min-width: 768px) { .cta__btn { font-size: 14px; line-height: 24px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--light); padding: 31.5px 0 106px; }
@media (min-width: 768px) { .site-footer { padding-bottom: 31.5px; } }
.site-footer__grid { display: grid; grid-template-columns: 1fr; gap: 21px; align-items: start; }
@media (min-width: 768px)  { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .site-footer__grid { grid-template-columns: repeat(4, 1fr); } }
.site-footer__logo { display: flex; justify-content: center; }
@media (min-width: 768px) { .site-footer__logo { justify-content: flex-start; } }
@media (min-width: 768px) { .site-footer__sep { display: none; } }
.site-footer h2 { font: 600 12px/22px var(--sans); margin-bottom: 7px; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer a:hover { color: var(--accent); }
.socials { display: flex; gap: 8px; margin-top: 10.5px; }
.socials svg { width: 20px; height: 20px; display: block; }

/* ---------- Archive / blog ---------- */
.page-wrap { padding: 56px 0 50px; }
@media (min-width: 768px) { .page-wrap { padding: 90px 0 68px; } }
.page-head { text-align: center; margin-bottom: 24px; }
@media (min-width: 1024px) { .page-head { margin-bottom: 52px; } }
.page-head h1 { font-family: var(--serif); font-size: 24px; line-height: 31px; margin-bottom: 7px; }
@media (min-width: 768px) { .page-head h1 { font-size: 36px; line-height: 45px; } }
.page-head p { font-family: var(--serif); color: var(--gray); font-size: 14px; line-height: 24px; }
.page-banner { margin-bottom: 54px; }
.page-banner img { width: 100%; }

.tabs { display: none; justify-content: center; margin-bottom: 28px; }
@media (min-width: 768px) { .tabs { display: flex; } }
.tabs ul {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; list-style: none;
	padding: 0; border-bottom: 1px solid var(--light);
}
@media (min-width: 1280px) { .tabs ul { gap: 48px; } }
.tabs a {
	display: block; padding: 7px 14px; font-family: var(--serif); font-size: 20px; line-height: 24px;
	color: var(--gray); text-transform: uppercase;
}
.tabs a:hover, .tabs .is-active a { color: var(--accent); font-weight: 700; }
.tabs-select { display: block; width: 100%; margin-bottom: 24px; padding: 10px; background: var(--bg); border: 1px solid var(--light); font-family: var(--serif); font-size: 16px; }
@media (min-width: 768px) { .tabs-select { display: none; } }

.grid-cards { display: grid; grid-template-columns: 1fr; gap: 24px; justify-items: center; }
@media (min-width: 768px)  { .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
@media (min-width: 1024px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }
.card-post { width: 100%; display: flex; flex-direction: column; }
@media (min-width: 768px)  { .card-post { max-width: 322px; } }
@media (min-width: 1024px) { .card-post { max-width: 379px; } }
.card-post__img { height: 258px; }
.card-post__img img, .card-post__img .placeholder { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; }
.card-post__body { display: flex; flex-direction: column; flex-grow: 1; }
.card-post__title { font-family: var(--serif); font-size: 22px; line-height: 29px; margin-bottom: 12px; }
@media (min-width: 768px) {
	.card-post__title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 87px; }
}
@media (min-width: 1280px) { .card-post__title { font-size: 24px; line-height: 31px; } .card-post__title a { min-height: 93px; } }
.card-post__title a:hover, .label a:hover { color: var(--accent); }
.card-post .text-body { flex-grow: 1; margin-bottom: 18px; }
.card-post .btn-outline { margin-top: auto; }

.pagination { margin-top: 48px; display: flex; justify-content: center; gap: 8px; font-family: var(--serif); font-size: 18px; }
.pagination .page-numbers { padding: 4px 12px; }
.pagination .current { border-bottom: 1px solid var(--fg); }

/* ---------- Single (post, page, property) ---------- */
.single-head { text-align: center; padding-top: 56px; }
.single-head h1 { font-family: var(--serif); font-size: 32px; line-height: 40px; }
.single-head__meta { font: 400 14px/22px var(--sans); margin-top: 12px; text-transform: uppercase; }
.single-hero { margin-top: 48px; }
.single-hero img { width: 100%; }
.entry-content { padding: 48px 0 68px; font-family: var(--serif); font-size: 12px; line-height: 21.5px; }
@media (min-width: 768px)  { .entry-content { font-size: 14px; line-height: 24px; } }
@media (min-width: 1024px) { .entry-content { padding-top: 68px; } }
.entry-content > * { max-width: 600px; margin-inline: auto; }
.entry-content > .alignwide, .entry-content > .wp-block-columns, .entry-content > .wp-block-gallery,
.entry-content > .wp-block-separator, .entry-content > .rooms-title { max-width: none; }
.entry-content > .alignfull { max-width: none; margin-inline: calc(50% - 50vw); }
.entry-content > * + * { margin-top: 24px; }
.entry-content > .wp-block-columns + .wp-block-columns,
.entry-content > .wp-block-gallery + *, .entry-content > * + .wp-block-gallery { margin-top: 68px; }
.entry-content h2 { font-size: 28px; line-height: 1; margin-top: 48px; }
.entry-content h3 { font-size: 24px; line-height: 31px; margin-top: 36px; }
@media (min-width: 768px) { .entry-content h2 { font-size: 32px; line-height: 40px; } }
.entry-content p + p { margin-top: 12px; }
.entry-content ul, .entry-content ol { padding-left: 20px; }
.entry-content a:not(.wp-block-button__link) { text-decoration: underline; text-underline-offset: 3px; }
.entry-content figcaption { font: 12px/20px var(--sans); color: var(--gray); margin-top: 8px; text-align: center; }
.single-post .entry-content > * { max-width: 760px; }
.single-post .entry-content > .alignwide, .single-post .entry-content > .wp-block-gallery { max-width: none; }

.wp-block-button__link {
	background: var(--fg); color: var(--white); border-radius: 0; padding: 14px 72px;
	font: 400 14px/21px var(--sans);
}
.wp-block-button.is-style-outline .wp-block-button__link { background: none; color: var(--fg); border: 1px solid var(--fg); padding: 3.5px 48px; }
.wp-block-separator { border: 0; border-top: 1px solid var(--light); margin-block: 48px; opacity: 1; }
.wp-block-separator.is-style-dashed { border-top-style: dashed; }
.entry-content .rooms-title { font-size: 28px; line-height: 1; color: var(--gray); margin-top: 68px; }
@media (min-width: 768px) { .entry-content .rooms-title { font-size: 32px; line-height: 40px; } }

/* Room row: gallery slider + text */
.room-row { gap: 28px !important; }
@media (min-width: 1024px) { .room-row { gap: 42px !important; } }
.room-row h3 { margin-top: 0; font-size: 28px; line-height: 1; margin-bottom: 21px; }
.room-row .wp-block-buttons { margin-top: 28px; }

/* Gallery style: horizontal strip */
.wp-block-gallery.is-style-annam-strip {
	display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 24px !important;
	scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 10px;
}
.wp-block-gallery.is-style-annam-strip::-webkit-scrollbar { display: none; }
.wp-block-gallery.is-style-annam-strip > figure.wp-block-image {
	flex: 0 0 auto !important; width: auto !important; margin: 0 !important; scroll-snap-align: start;
}
.wp-block-gallery.is-style-annam-strip > figure img { height: 250px !important; width: auto !important; object-fit: cover; }

/* Gallery style: single-image slider (JS adds arrows + dots) */
.annam-slider { position: relative; }
.wp-block-gallery.is-style-annam-slider {
	display: flex !important; flex-wrap: nowrap !important; gap: 0 !important; overflow-x: auto;
	scroll-snap-type: x mandatory; scrollbar-width: none; height: 257px; margin: 0;
}
@media (min-width: 768px)  { .wp-block-gallery.is-style-annam-slider { height: 340px; } }
@media (min-width: 1024px) { .wp-block-gallery.is-style-annam-slider { height: 436px; } }
.wp-block-gallery.is-style-annam-slider::-webkit-scrollbar { display: none; }
.wp-block-gallery.is-style-annam-slider > figure.wp-block-image {
	flex: 0 0 100% !important; width: 100% !important; margin: 0 !important; scroll-snap-align: start; height: 100%;
}
.wp-block-gallery.is-style-annam-slider > figure img { width: 100% !important; height: 100% !important; object-fit: cover; }
.annam-slider__arrow {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 35px; height: 35px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	background: rgba(48, 52, 56, .5); color: #fff; transition: background .3s;
}
.annam-slider__arrow:hover { background: rgba(48, 52, 56, .8); }
.annam-slider__arrow.prev { left: 21.5px; }
.annam-slider__arrow.next { right: 21.5px; }
.annam-slider__arrow svg { width: 16px; height: 16px; }
.annam-slider__bar { display: flex; align-items: center; margin-top: 14px; }
.annam-slider__index { flex-grow: 1; font: 12px/22px var(--sans); }
.annam-slider__dots { display: flex; gap: 8px; }
.annam-slider__dots button { width: 18px; height: 4px; border-radius: 10px; background: var(--light); transition: background .2s; }
.annam-slider__dots button.is-active { background: var(--fg); }

.related { padding-bottom: 88px; }
.not-found { text-align: center; padding: 120px 0; }
.not-found h1 { font-family: var(--serif); font-size: 36px; line-height: 45px; margin-bottom: 21px; }
