/**
 * DHRCA Registry — public front-end (Kovil finder / directory).
 *
 * Rendered inside whatever theme the site uses, and alongside Elementor, so
 * every rule is scoped under .dhrca-finder and resets what a theme would
 * otherwise impose on buttons, inputs and lists.
 */

.dhrca-finder {
	--dhrca-maroon: #762f03;
	--dhrca-dark: #3f1801;
	--dhrca-gold: #c99700;
	--dhrca-sand: #f2e9da;
	--dhrca-paper: #faf6ef;
	--dhrca-line: #e4d8c3;
	--dhrca-ink: #241c12;
	--dhrca-muted: #756750;

	color: var(--dhrca-ink);
	font-size: 16px;
	line-height: 1.6;
}

.dhrca-finder *,
.dhrca-finder *::before,
.dhrca-finder *::after { box-sizing: border-box; }

/* Head --------------------------------------------------------------------- */

.dhrca-finder__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.dhrca-finder__title {
	font-size: 28px;
	line-height: 1.25;
	margin: 0 0 6px;
	color: var(--dhrca-ink);
}

.dhrca-finder__intro { margin: 0; color: var(--dhrca-muted); }

.dhrca-finder__all {
	color: var(--dhrca-maroon);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	padding-top: 6px;
}

.dhrca-finder__all:hover,
.dhrca-finder__all:focus-visible { text-decoration: underline; }

.dhrca-finder__count { color: var(--dhrca-muted); margin: 0 0 16px; }

/* Search form -------------------------------------------------------------- */

.dhrca-finder__form {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 24px;
	
    width: 100%;
    max-width: 700px;
}

.dhrca-finder__form input[type="search"] {
	flex: 1 1 260px;
	min-width: 0;
}

.dhrca-finder__form select { flex: 0 1 200px; }

.dhrca-finder__form input[type="search"],
.dhrca-finder__form select {
	min-height: 48px;
	padding: 12px 14px;
	border: 1.5px solid var(--dhrca-line);
	border-radius: 8px;
	background: #fff;
	color: var(--dhrca-ink);
	font-size: 16px; /* 16px stops iOS zooming on focus */
	font-family: inherit;
	line-height: 1.4;
	box-shadow: none;
}

.dhrca-finder__form input[type="search"]:focus,
.dhrca-finder__form select:focus,
.dhrca-finder__submit:focus-visible {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 1px;
	border-color: var(--dhrca-maroon);
}

.dhrca-finder__submit {
	min-height: 48px;
	padding: 12px 28px;
	border: 0 !important;
	border-radius: 8px;
	background: var(--dhrca-maroon);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.4;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	transition: background .15s ease;
}

.dhrca-finder__submit:hover { background: var(--dhrca-dark) !important; border: 0 !important; }

/* Cards -------------------------------------------------------------------- */

.dhrca-kovils {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

@media (min-width: 560px) {
	.dhrca-kovils { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
	.dhrca-kovils { grid-template-columns: repeat(4, 1fr); }
}

.dhrca-kovil { margin: 0; }

.dhrca-kovil__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid var(--dhrca-line);
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.dhrca-kovil__link:hover,
.dhrca-kovil__link:focus-visible {
	border-color: var(--dhrca-gold);
	box-shadow: 0 8px 22px rgba(60, 20, 10, .1);
	transform: translateY(-2px);
}

.dhrca-kovil__link:focus-visible {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 2px;
}

.dhrca-kovil__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--dhrca-sand);
	overflow: hidden;
}

.dhrca-kovil__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Most records launch without a photograph — make that look deliberate. */
.dhrca-kovil__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #c9b48c;
	background-image: repeating-linear-gradient(
		135deg,
		transparent 0,
		transparent 9px,
		rgba(118, 47, 3, .05) 9px,
		rgba(118, 47, 3, .05) 10px
	);
}

.dhrca-kovil__body {
	display: block;
	padding: 14px 16px 16px;
}

.dhrca-kovil__name {
	display: block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--dhrca-ink);
}

.dhrca-kovil__name-ta {
	display: block;
	margin-top: 3px;
	font-size: 14px;
	line-height: 1.7; /* Tamil needs more vertical room than Latin */
	color: var(--dhrca-muted);
}

.dhrca-kovil__meta {
	display: block;
	margin-top: 9px;
	font-size: 13px;
	color: var(--dhrca-muted);
}

.dhrca-finder__empty {
	padding: 28px 20px;
	text-align: center;
	color: var(--dhrca-muted);
	background: var(--dhrca-paper);
	border: 1px dashed var(--dhrca-line);
	border-radius: 10px;
}

/* Pagination --------------------------------------------------------------- */

.dhrca-pager {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 28px;
}

.dhrca-pager__link {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	border: 1px solid var(--dhrca-line);
	border-radius: 8px;
	background: #fff;
	color: var(--dhrca-maroon);
	font-weight: 600;
	text-decoration: none;
}

.dhrca-pager__link:hover { background: var(--dhrca-paper); }

.dhrca-pager__link.is-current {
	background: var(--dhrca-maroon);
	border-color: var(--dhrca-maroon);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.dhrca-kovil__link { transition: none; }
	.dhrca-kovil__link:hover { transform: none; }
}

/* Festivals ---------------------------------------------------------------- */

.dhrca-festivals__month {
	font-size: 18px;
	margin: 30px 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--dhrca-gold);
	color: var(--dhrca-ink);
}

.dhrca-fest-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}

.dhrca-fest { margin: 0; }

.dhrca-fest__link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid var(--dhrca-line);
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.dhrca-fest__link:hover,
.dhrca-fest__link:focus-visible {
	border-color: var(--dhrca-gold);
	box-shadow: 0 6px 18px rgba(60, 20, 10, .09);
}

.dhrca-fest__link:focus-visible {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 2px;
}

.dhrca-fest__date {
	flex: 0 0 56px;
	text-align: center;
	line-height: 1.1;
}

.dhrca-fest__day {
	display: block;
	font-size: 24px;
	font-weight: 700;
	color: var(--dhrca-maroon);
}

.dhrca-fest__mon {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--dhrca-muted);
}

.dhrca-fest__body { flex: 1 1 auto; min-width: 0; }

.dhrca-fest__name {
	display: block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
}

.dhrca-fest__name-ta {
	display: block;
	margin-top: 2px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--dhrca-muted);
}

.dhrca-fest__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin-top: 6px;
	font-size: 13px;
	color: var(--dhrca-muted);
}

.dhrca-fest__days::before { content: "⏱ "; }
.dhrca-fest__where::before { content: "📍 "; }

.dhrca-fest__holiday {
	flex: 0 0 auto;
	align-self: flex-start;
	padding: 3px 9px;
    border-radius: 10px;
	background: var(--dhrca-sand);
	color: var(--dhrca-maroon);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.dhrca-fest__link { flex-wrap: wrap; }
	.dhrca-fest__holiday { order: 3; margin-left: 72px; }
}

/* Calendar: controls ------------------------------------------------------- */

.dhrca-cal__search {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	padding: 14px;
	margin-bottom: 18px;
	background: var(--dhrca-paper);
	border: 1px solid var(--dhrca-line);
	border-radius: 10px;
}

.dhrca-cal__search input[type="search"] { flex: 1 1 240px; min-width: 0; }
.dhrca-cal__search select { flex: 0 1 190px; }

.dhrca-cal__search input[type="search"],
.dhrca-cal__search select {
	min-height: 46px;
	padding: 10px 13px;
	border: 1.5px solid var(--dhrca-line);
	border-radius: 8px;
	background: #fff;
	color: var(--dhrca-ink);
	font-size: 16px; /* 16px stops iOS zooming on focus */
	font-family: inherit;
}

.dhrca-cal__search input[type="search"]:focus,
.dhrca-cal__search select:focus {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 1px;
	border-color: var(--dhrca-maroon);
}

.dhrca-cal__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.dhrca-cal__move { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.dhrca-cal__arrow,
.dhrca-cal__today,
.dhrca-cal__view {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--dhrca-line);
	border-radius: 8px;
	background: #fff;
	color: var(--dhrca-maroon);
	font-weight: 600;
	text-decoration: none;
	line-height: 1;
}

.dhrca-cal__arrow { font-size: 22px; padding: 0; }

.dhrca-cal__arrow:hover,
.dhrca-cal__today:hover,
.dhrca-cal__view:hover { background: var(--dhrca-paper); }

.dhrca-cal__arrow:focus-visible,
.dhrca-cal__today:focus-visible,
.dhrca-cal__view:focus-visible {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 2px;
}

.dhrca-cal__month {
	margin: 0 0 0 6px;
	font-size: 24px;
	line-height: 1.2;
	color: var(--dhrca-ink);
}

.dhrca-cal__views { display: flex; gap: 6px; }

.dhrca-cal__view.is-current {
	background: var(--dhrca-maroon);
	border-color: var(--dhrca-maroon);
	color: #fff;
}

.dhrca-cal__filtered {
	margin: -4px 0 16px;
	font-size: 14px;
	color: var(--dhrca-muted);
}

/* Calendar: month grid ----------------------------------------------------- */

.dhrca-cal__grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	background: #fff;
	border: 1px solid var(--dhrca-line);
	border-radius: 10px;
	overflow: hidden;
}

.dhrca-cal__grid th {
	padding: 10px 8px;
	background: var(--dhrca-paper);
	border-bottom: 1px solid var(--dhrca-line);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--dhrca-muted);
	text-align: left;
}

.dhrca-cal__grid th abbr { text-decoration: none; border: 0; }

.dhrca-cal__cell {
	vertical-align: top;
	height: 118px;
	padding: 6px 7px 8px;
	border: 1px solid var(--dhrca-line);
	border-width: 0 1px 1px 0;
}

.dhrca-cal__cell:last-child { border-right: 0; }
.dhrca-cal__cell.is-outside { background: #fbf8f3; }
.dhrca-cal__cell.is-outside .dhrca-cal__daynum { color: #bcae95; }

.dhrca-cal__daynum {
	display: block;
	margin-bottom: 5px;
	font-size: 15px;
	font-weight: 700;
	color: var(--dhrca-ink);
}

.dhrca-cal__cell.is-today .dhrca-cal__daynum {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 6px;
	border-radius: 14px;
	background: var(--dhrca-maroon);
	color: #fff;
}

.dhrca-cal__events { list-style: none; margin: 0; padding: 0; }
.dhrca-cal__event { margin: 0 0 4px; }

.dhrca-cal__event a {
	display: block;
	padding: 4px 7px;
	border-left: 3px solid var(--dhrca-gold);
	border-radius: 0 5px 5px 0;
	background: var(--dhrca-sand);
	color: var(--dhrca-ink);
	font-size: 12.5px;
	line-height: 1.35;
	text-decoration: none;
}

.dhrca-cal__event a:hover,
.dhrca-cal__event a:focus-visible { background: #ecdfc9; }

.dhrca-cal__event a:focus-visible {
	outline: 2px solid rgba(201, 151, 0, .6);
	outline-offset: 1px;
}

/* Public holidays are the ones people plan around, so they carry a second
   cue beyond colour: a heavier rule and bold text. */
.dhrca-cal__event.is-holiday a {
	border-left-color: var(--dhrca-maroon);
	border-left-width: 4px;
	font-weight: 700;
}

.dhrca-cal__time { display: block; font-size: 11px; color: var(--dhrca-muted); }
.dhrca-cal__name { display: block; }

/* Below tablet a seven-column grid stops being readable, so the cells stack
   into a single column and empty days drop out entirely. */
@media (max-width: 700px) {
	.dhrca-cal__grid,
	.dhrca-cal__grid thead,
	.dhrca-cal__grid tbody,
	.dhrca-cal__grid tr,
	.dhrca-cal__cell { display: block; width: 100%; }

	.dhrca-cal__grid thead { display: none; }
	.dhrca-cal__grid { border-radius: 10px; }

	.dhrca-cal__cell {
		height: auto;
		min-height: 0;
		padding: 10px 12px;
		border-width: 0 0 1px;
	}

	.dhrca-cal__cell.is-outside,
	.dhrca-cal__cell:not(.has-events):not(.is-today) { display: none; }

	.dhrca-cal__daynum::after {
		content: " " attr(data-weekday);
		font-weight: 400;
		color: var(--dhrca-muted);
	}
}

/* Single festival page ----------------------------------------------------- */

.dhrca-fpage__when {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	padding: 16px 18px;
	margin-bottom: 22px;
	background: var(--dhrca-paper);
	border: 1px solid var(--dhrca-line);
	border-left: 4px solid var(--dhrca-maroon);
	border-radius: 0 10px 10px 0;
}

.dhrca-fpage__nextdate {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--dhrca-ink);
}

.dhrca-fpage__nexttime { margin: 0; color: var(--dhrca-muted); }

.dhrca-fpage__media { margin: 0 0 22px; }

.dhrca-fpage__media img {
	width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}

.dhrca-fpage__desc { margin-bottom: 22px; }

.dhrca-fpage__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }

.dhrca-fpage__btn {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border-radius: 8px;
	background: var(--dhrca-maroon);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .02em;
	text-decoration: none;
}

.dhrca-fpage__btn:hover { background: var(--dhrca-dark); color: #fff; }

.dhrca-fpage__btn:focus-visible {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 2px;
}

.dhrca-fpage__h {
	font-size: 20px;
	margin: 28px 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--dhrca-gold);
}

.dhrca-fpage__facts { margin: 0; }
.dhrca-fpage__facts dt { font-weight: 700; margin-top: 12px; }
.dhrca-fpage__facts dd { margin: 3px 0 0; color: var(--dhrca-muted); }
.dhrca-fpage__facts dd a { color: var(--dhrca-maroon); }

.dhrca-fpage__dates { list-style: none; margin: 0; padding: 0; }

.dhrca-fpage__dates li {
	padding: 9px 0;
	border-bottom: 1px solid var(--dhrca-line);
}

.dhrca-fpage__dates li.is-past { opacity: .55; }
.dhrca-fpage__dates li:last-child { border-bottom: 0; }

.dhrca-fest__time::before { content: "🕑 "; }

/* The year, shown only when an occurrence is not in the current year — the
   date chip has no room for it and two years otherwise look identical. */
.dhrca-fest__year {
	font-weight: 600;
	color: var(--dhrca-maroon);
}

.dhrca-fest__year::before { content: "📅 "; }

/* Resources ---------------------------------------------------------------- */

.dhrca-resources__title {
	font-size: 21px;
	margin: 0 0 14px;
	padding-bottom: 9px;
	border-bottom: 2px solid var(--dhrca-gold);
	color: var(--dhrca-ink);
}

.dhrca-res-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.dhrca-res { margin: 0; }

.dhrca-res__link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	min-height: 56px;
	background: #fff;
	border: 1px solid var(--dhrca-line);
	border-radius: 10px;
	text-decoration: none;
	color: var(--dhrca-ink);
	transition: border-color .18s ease, box-shadow .18s ease;
}

.dhrca-res__link:hover,
.dhrca-res__link:focus-visible {
	border-color: var(--dhrca-gold);
	box-shadow: 0 6px 18px rgba(60, 20, 10, .09);
	color: var(--dhrca-ink);
}

.dhrca-res__link:focus-visible {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 2px;
}

/* A line with no link is still information, so it keeps the card but loses
   the affordances that would suggest it is clickable. */
.dhrca-res__link.is-plain {
	background: var(--dhrca-paper);
	color: var(--dhrca-muted);
	cursor: default;
}

.dhrca-res__icon {
	flex: 0 0 auto;
	display: flex;
	color: var(--dhrca-maroon);
}

.dhrca-res__link.is-plain .dhrca-res__icon { color: #bfae8e; }

.dhrca-res__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 9px;
	flex-wrap: wrap;
}

.dhrca-res__name { font-size: 16px; }

.dhrca-res__kind {
	padding: 2px 7px;
	border-radius: 4px;
	background: var(--dhrca-sand);
	color: var(--dhrca-maroon);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .05em;
}

.dhrca-res__go {
	flex: 0 0 auto;
	color: var(--dhrca-maroon);
	font-size: 14px;
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.dhrca-res__link { transition: none; }
}

/* Gallery ------------------------------------------------------------------ */

.dhrca-gallery__title {
	font-size: 21px;
	margin: 0 0 16px;
	padding-bottom: 9px;
	border-bottom: 2px solid var(--dhrca-gold);
}

.dhrca-gallery__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 700px) {
	.dhrca-gallery__grid {
		grid-template-columns: repeat(var(--dhrca-cols, 4), minmax(0, 1fr));
	}
}

.dhrca-gallery__item { margin: 0; }

.dhrca-gallery__link {
	display: block;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--dhrca-line);
	border-radius: 10px;
	overflow: hidden;
	background: var(--dhrca-sand);
	transition: border-color .18s ease, box-shadow .18s ease;
}

.dhrca-gallery__link:hover,
.dhrca-gallery__link:focus-visible {
	border-color: var(--dhrca-gold);
	box-shadow: 0 6px 18px rgba(60, 20, 10, .1);
}

.dhrca-gallery__link:focus-visible {
	outline: 3px solid rgba(201, 151, 0, .45);
	outline-offset: 2px;
}

.dhrca-gallery__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Fallback lightbox (Elementor supplies its own where it is running) --------- */

body.dhrca-lb-open { overflow: hidden; }

.dhrca-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 24px;
	background: rgba(18, 9, 3, .92);
}

.dhrca-lb[hidden] { display: none; }

.dhrca-lb__figure {
	margin: 0;
	max-width: min(1200px, 92vw);
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.dhrca-lb__img {
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	border-radius: 8px;
	display: block;
	background: #241c12;
}

.dhrca-lb__cap {
	margin: 0;
	color: rgba(255, 255, 255, .82);
	font-size: 14px;
	text-align: center;
	max-width: 60ch;
}

.dhrca-lb__close,
.dhrca-lb__nav {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 24px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.dhrca-lb__close:hover,
.dhrca-lb__nav:hover { background: rgba(255, 255, 255, .22); }

.dhrca-lb__close:focus-visible,
.dhrca-lb__nav:focus-visible {
	outline: 3px solid var(--dhrca-gold, #c99700);
	outline-offset: 2px;
}

.dhrca-lb__close {
	position: absolute;
	top: 16px;
	right: 16px;
	font-size: 30px;
}

.dhrca-lb__count {
	position: absolute;
	bottom: 16px;
	left: 0;
	right: 0;
	margin: 0;
	text-align: center;
	color: rgba(255, 255, 255, .66);
	font-size: 13px;
	letter-spacing: .04em;
}

/* On a phone the side arrows would cover the picture. */
@media (max-width: 600px) {
	.dhrca-lb { padding: 12px; }
	.dhrca-lb__nav { position: absolute; bottom: 44px; }
	.dhrca-lb__nav--prev { left: 20px; }
	.dhrca-lb__nav--next { right: 20px; }
	.dhrca-lb__img { max-height: 68vh; }
}
