/*
Theme Name: Apsara Events — Sindoor
Theme URI: https://www.anapsaraevent.com
Author: Rivers Studios
Author URI: https://www.riversstudios.com
Description: Custom block theme for Apsara Events. Moody couture editorial: kohl and ember grounds, sindoor red, antique gold, Bodoni Moda headlines, Instrument Sans body, Devanagari ritual names. Wedding pages list themselves automatically.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 3.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apsara
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--sindoor); color: var(--wp--preset--color--ivory); }
:where(a, button, input, select, textarea, .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}
.wp-site-blocks > * + * { margin-block-start: 0; }
p { color: var(--wp--preset--color--parchment); }

/* Headlines: the italic turn carries the voice */
:where(h1, h2, h3) em { font-style: italic; color: var(--wp--preset--color--gold); }

/* ---------- Header ---------- */
.ap-header { position: relative; z-index: 30; }
.ap-header .ap-logo { margin: 0; }
.ap-header .ap-logo img { width: 200px; height: auto; display: block; }
.ap-header .wp-block-navigation a:hover { color: var(--wp--preset--color--gold); }
.ap-header .ap-nav-cta a { border-bottom: 1px solid var(--wp--preset--color--gold); padding-bottom: 2px; }
/* Header sits over the hero photo on landing pages */
.page-template-landing .ap-header { position: absolute; inset: 0 0 auto 0; }
.admin-bar.page-template-landing .ap-header { top: 32px; }
@media (max-width: 782px) {
	.ap-header .ap-logo img { width: 150px; }
	.admin-bar.page-template-landing .ap-header { top: 46px; }
}

/* ---------- Type roles ---------- */
.ap-kicker {
	font-size: 0.875rem !important;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--gold) !important;
	margin-bottom: 0.25rem !important;
}
.ap-spaced { font-size: 0.8125rem; letter-spacing: 0.32em; color: var(--wp--preset--color--taupe); }
.ap-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.6; max-width: 34em; }
.ap-note { font-size: 0.95rem; color: var(--wp--preset--color--taupe); }
.ap-italic { font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: 1.25rem; color: var(--wp--preset--color--gold); margin-bottom: 0.25rem !important; }
.ap-textlink a { border-bottom: 1px solid var(--wp--preset--color--gold); padding-bottom: 2px; }

/* ---------- Hero (cover) ---------- */
.wp-block-cover.ap-hero { padding-bottom: var(--wp--preset--spacing--50); padding-top: 9rem; }
.wp-block-cover.ap-hero .wp-block-cover__inner-container { max-width: 1360px; margin-inline: auto; width: 100%; }
.ap-hero h1 { max-width: 11em; margin-top: 0.5rem; }
.ap-hero .ap-lead { color: var(--wp--preset--color--parchment); }
.ap-hero-row { gap: 1.25rem 3rem !important; }
.ap-hero-row p { max-width: 30em; margin: 0; }
/* One orchestrated entrance: the photo settles, the words rise */
.ap-hero .wp-block-cover__image-background { animation: ap-settle 2.2s cubic-bezier(.2,.7,.1,1) both; }
.ap-hero .wp-block-cover__inner-container > * { animation: ap-rise 1s cubic-bezier(.2,.7,.1,1) both; }
.ap-hero .wp-block-cover__inner-container > *:nth-child(2) { animation-delay: .12s; }
.ap-hero .wp-block-cover__inner-container > *:nth-child(3) { animation-delay: .24s; }
.ap-hero .wp-block-cover__inner-container > *:nth-child(4) { animation-delay: .36s; }
@keyframes ap-settle { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes ap-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.ap-hero .wp-block-cover__image-background,
	.ap-hero .wp-block-cover__inner-container > * { animation: none; }
}

/* ---------- Rotating hero ---------- */
.ap-hero-slides { display: none !important; }
.ap-rotate .wp-block-cover__image-background.ap-slide { opacity: 0; transition: opacity 1.8s ease-in-out; }
.ap-rotate .wp-block-cover__image-background.ap-slide.is-active { opacity: 1; }
.ap-rotate .wp-block-cover__background { z-index: 1; }
.ap-rotate .wp-block-cover__inner-container { z-index: 2; }
.editor-styles-wrapper .ap-hero-slides { display: grid !important; opacity: 0.6; }

/* ---------- Traditions ---------- */
.ap-traditions-wrap { border-top: 1px solid var(--wp--preset--color--line); padding-top: 2.5rem; }
.ap-traditions { gap: 1.75rem 2.5rem !important; }
.ap-tradition h4 { font-size: 1.45rem; margin: 0 0 0.4rem; }
.ap-tradition p { margin: 0; font-size: 0.975rem; color: var(--wp--preset--color--taupe); }

/* ---------- Ritual sequence ---------- */
.ap-rituals { border-top: 1px solid var(--wp--preset--color--line); gap: 0 2rem !important; }
.ap-ritual { padding: 2.25rem 1.5rem 2.5rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.ap-ritual .ap-ritual-head { justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.ap-ritual .ap-num { font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: 1.25rem; color: var(--wp--preset--color--gold); margin: 0; }
.ap-ritual .ap-deva { font-family: var(--wp--preset--font-family--devanagari); font-size: 1.4rem; color: var(--wp--preset--color--taupe); margin: 0; line-height: 1.2; }
.ap-ritual h3 { margin: 0 0 0.6rem; }
.ap-ritual p { margin: 0; }

/* ---------- Ivory sections ---------- */
.ap-ivory, .ap-ivory p { color: var(--wp--preset--color--kohl); }
.ap-ivory :where(h1, h2, h3, h4) { color: var(--wp--preset--color--kohl); }
.ap-ivory :where(h1, h2, h3) em { color: var(--wp--preset--color--sindoor); }
.ap-ivory a { color: var(--wp--preset--color--kohl); }
.ap-ivory a:hover { color: var(--wp--preset--color--sindoor); }
.ap-ivory .ap-kicker { color: var(--wp--preset--color--sindoor) !important; }
.ap-ivory .ap-textlink a { border-color: var(--wp--preset--color--sindoor); }
.ap-ivory .wp-element-button { background: var(--wp--preset--color--kohl); color: var(--wp--preset--color--ivory); border-color: var(--wp--preset--color--kohl); }
.ap-ivory .wp-element-button:hover { background: var(--wp--preset--color--sindoor); border-color: var(--wp--preset--color--sindoor); color: var(--wp--preset--color--ivory); }

/* ---------- Wedding cards (Query Loop) ---------- */
.ap-wedding-grid .wp-block-post-template { gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem) !important; }
.ap-wedding-grid .wp-block-post-featured-image { margin: 0 0 1.1rem; overflow: hidden; }
.ap-wedding-grid .wp-block-post-featured-image img { aspect-ratio: 4 / 5; width: 100%; height: auto; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.1,1); }
.ap-wedding-grid .wp-block-post-featured-image a:hover img { transform: scale(1.035); }
.ap-wedding-grid .wp-block-post-title { font-size: 2rem; line-height: 1.05; margin: 0 0 0.35rem; }
.ap-wedding-grid .wp-block-post-excerpt { margin: 0; }
.ap-wedding-grid .wp-block-post-excerpt__excerpt { font-size: 0.9375rem; color: var(--wp--preset--color--taupe); margin: 0; }
.ap-ivory .ap-wedding-grid .wp-block-post-excerpt__excerpt { color: var(--wp--preset--color--cocoa); }
.ap-wedding-grid .wp-block-post-excerpt__more-text { display: none; }
@media (prefers-reduced-motion: reduce) { .ap-wedding-grid .wp-block-post-featured-image img { transition: none; } }

/* ---------- Services ---------- */
.ap-service-row { align-items: center !important; }
.ap-service-row + .ap-service-row { margin-top: var(--wp--preset--spacing--60) !important; }
.ap-portrait img { aspect-ratio: 4 / 5; width: 100%; height: auto; object-fit: cover; }

/* ---------- Single wedding ---------- */
.ap-details { border-top: 1px solid var(--wp--preset--color--line); border-bottom: 1px solid var(--wp--preset--color--line); padding-block: 1.4rem; gap: 1.25rem 2.5rem !important; }
.ap-details p { margin: 0; }
.ap-details .ap-label { font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: 1.05rem; color: var(--wp--preset--color--gold); }
.ap-wedding-gallery.wp-block-gallery { gap: 0.75rem !important; }
.ap-wedding-gallery.wp-block-gallery.has-nested-images { display: block !important; column-count: 3; column-gap: .75rem; }
.ap-wedding-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#ap) { width: 100% !important; max-width: 100% !important; margin: 0 0 .75rem !important; display: block !important; break-inside: avoid; }
.ap-wedding-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#ap) img { width: 100% !important; height: auto !important; object-fit: contain !important; }
@media (max-width: 781px) { .ap-wedding-gallery.wp-block-gallery.has-nested-images { column-count: 2; } }
@media (max-width: 480px) { .ap-wedding-gallery.wp-block-gallery.has-nested-images { column-count: 1; } }

/* ---------- Services grid, places, about ---------- */
.ap-services4 { gap: 2.5rem 2rem !important; }
.ap-service { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1.5rem; }
.ap-service h3 { font-size: 2rem; margin: 0 0 0.75rem; }
.ap-service p { margin: 0 0 0.75rem; }
.ap-where { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1.75rem; }
.ap-places { font-family: var(--wp--preset--font-family--display); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.5; color: var(--wp--preset--color--ivory) !important; margin: 0; }
.ap-about-row { align-items: flex-start !important; border-top: 1px solid var(--wp--preset--color--line); padding-top: 2rem; }

/* ---------- Preferred venues ---------- */
.ap-venue-region { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1.75rem; margin-top: 0 !important; }
.ap-venue-region + .ap-venue-region { margin-top: 2.5rem !important; }
.ap-venue { padding: 0 0 1.4rem; }
.ap-venue + .ap-venue { padding-top: 1.4rem; border-top: 1px solid rgba(201, 180, 154, 0.18); }
.ap-venue h3 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); margin: 0 0 0.35rem; }
.ap-venue-meta { margin: 0; font-size: 0.9375rem; color: var(--wp--preset--color--taupe) !important; }
.ap-venue-meta a { border-bottom: 1px solid var(--wp--preset--color--line); }
.ap-venue-meta a:hover { border-color: var(--wp--preset--color--gold); }

/* ---------- Bands ---------- */
.ap-band-sindoor p, .ap-band-sindoor :where(h1, h2, h3) { color: var(--wp--preset--color--ivory); }
.ap-band-sindoor :where(h1, h2, h3) em { color: var(--wp--preset--color--ivory); }
.ap-band-sindoor .wp-element-button { background: var(--wp--preset--color--kohl); color: var(--wp--preset--color--ivory); border-color: var(--wp--preset--color--kohl); }
.ap-band-sindoor .wp-element-button:hover { background: var(--wp--preset--color--ivory); color: var(--wp--preset--color--kohl); border-color: var(--wp--preset--color--ivory); }

/* ---------- Footer ---------- */
.ap-footer { border-top: 1px solid var(--wp--preset--color--line); }
.ap-footer .ap-footer-logo img { width: min(560px, 80vw); height: auto; }
.ap-footer .ap-footer-line { font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.35; margin-top: 2rem; }
.ap-footer-meta { margin-top: var(--wp--preset--spacing--50) !important; gap: 0.75rem 2.5rem !important; font-size: 0.875rem; }
.ap-footer-meta p { color: var(--wp--preset--color--taupe); margin: 0; }

/* ---------- Contact form (Jetpack Forms) ---------- */
.wp-block-jetpack-contact-form { gap: 1.5rem; }
.wp-block-jetpack-contact-form :where(input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea) {
	width: 100%;
	background: transparent !important;
	border: 0 !important;
	border-bottom: 1px solid var(--wp--preset--color--taupe) !important;
	border-radius: 0 !important;
	padding: 0.7rem 0 !important;
	font: inherit;
	color: var(--wp--preset--color--ivory) !important;
}
.wp-block-jetpack-contact-form select option { color: var(--wp--preset--color--kohl); }
.wp-block-jetpack-contact-form :where(input, select, textarea):focus { border-bottom-color: var(--wp--preset--color--gold) !important; outline: none; box-shadow: 0 1px 0 var(--wp--preset--color--gold); }
.wp-block-jetpack-contact-form label { font-size: 0.8125rem; letter-spacing: 0.05em; color: var(--wp--preset--color--parchment); }
.wp-block-jetpack-contact-form :where(input[type=checkbox], input[type=radio]) { accent-color: var(--wp--preset--color--sindoor); }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.wp-block-cover.ap-hero { padding-top: 7rem; min-height: 86vh !important; }
	.ap-service-row .wp-block-column:has(.ap-portrait) { order: -1; }
	.ap-ritual { padding-right: 0; }
}


/* =========================================================
   Refinement layer (v2.5): quieter, more editorial
   ========================================================= */
:root { --ap-hair: rgba(201, 180, 154, 0.22); }
body { font-feature-settings: "kern", "liga", "onum"; letter-spacing: 0.002em; }
:where(h1, h2, h3) { text-wrap: balance; font-optical-sizing: auto; }
p { text-wrap: pretty; hanging-punctuation: first; }
:where(h1, h2) em { font-weight: 400; }

/* Fine film grain over dark grounds: depth without decoration */
body::after {
	content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.045; mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Kickers: small, spaced capitals, the voice of a printed invitation */
.ap-kicker { text-transform: uppercase; font-size: 0.72rem !important; letter-spacing: 0.26em; font-weight: 500; }
.ap-kicker::before { content: ""; display: inline-block; width: 2.25rem; height: 1px; background: currentColor; vertical-align: middle; margin-right: 0.9rem; opacity: 0.7; }
.has-text-align-center.ap-kicker::before { display: none; }
.ap-italic { font-size: 1.15rem; letter-spacing: 0.01em; }

/* Hero: a soft fall-off so type always sits on shadow */
.wp-block-cover.ap-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
	background: linear-gradient(180deg, rgba(28,18,16,0.55) 0%, rgba(28,18,16,0) 28%, rgba(28,18,16,0) 55%, rgba(28,18,16,0.7) 100%); }
.wp-block-cover.ap-hero .wp-block-cover__inner-container { z-index: 2; }
.ap-hero h1 { letter-spacing: -0.03em; }

/* Links: hairline underlines with breathing room */
.ap-textlink a, .ap-footer-places a, .ap-venue-meta a { text-underline-offset: 0.3em; }
.ap-textlink a { letter-spacing: 0.04em; font-size: 0.9rem; text-transform: uppercase; }

/* Press and places rows */
.ap-press { border-top: 1px solid var(--ap-hair); border-bottom: 1px solid var(--ap-hair); }
.ap-press-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 3rem; font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: clamp(1.35rem, 2.4vw, 1.9rem); color: var(--wp--preset--color--ivory) !important; }
.ap-press-names a, .ap-press-names span { color: var(--wp--preset--color--ivory); }
.ap-press-names a:hover { color: var(--wp--preset--color--gold); }
.ap-locations { border-top: 0; }

/* FAQ: native accordions, answer-first typography */
.ap-faq { border-top: 1px solid var(--wp--preset--color--line); }
.ap-faq-item { border-bottom: 1px solid var(--wp--preset--color--line); padding: 1.35rem 0; }
.ap-faq-item summary { cursor: pointer; list-style: none; font-family: var(--wp--preset--font-family--display); font-size: clamp(1.25rem, 1.9vw, 1.55rem); line-height: 1.25; display: flex; justify-content: space-between; gap: 1.5rem; color: var(--wp--preset--color--ivory); }
.ap-faq-item summary::-webkit-details-marker { display: none; }
.ap-faq-item summary::after { content: "+"; font-family: var(--wp--preset--font-family--body); font-weight: 300; color: var(--wp--preset--color--gold); transition: transform .3s ease; }
.ap-faq-item[open] summary::after { transform: rotate(45deg); }
.ap-faq-item p { margin: 0.9rem 0 0; max-width: 46em; color: var(--wp--preset--color--parchment); }
.ap-faq-item summary:focus-visible { outline: 2px solid var(--wp--preset--color--gold); outline-offset: 4px; }

/* Location pages: wedding list */
.ap-loc-weddings { gap: 0 2.5rem !important; }
.ap-loc-weddings .ap-venue h4 { font-size: 1.6rem; margin: 0 0 0.25rem; }

/* Footer places line */
.ap-footer-places { font-size: 0.85rem; letter-spacing: 0.06em; color: var(--wp--preset--color--taupe) !important; margin-top: 1.5rem; }
.ap-footer-places a { color: var(--wp--preset--color--parchment); }

/* Images: a whisper of tone when hovered */
.ap-wedding-grid .wp-block-post-featured-image img { filter: saturate(0.92) contrast(1.02); }
.ap-wedding-grid .wp-block-post-featured-image a:hover img { filter: saturate(1) contrast(1.04); }

@media (prefers-reduced-motion: reduce) { .ap-faq-item summary::after { transition: none; } }
