/*
Theme Name: Nims Casa
Theme URI: https://nimscasa.com/
Author: Dhanvi Gupta
Description: Editorial theme for nimscasa.com, carrying the design of the original Next.js site into WordPress — pine, clay and cream, with Fraunces for display. Pairs with the Sitecraft Blocks plugin, whose section blocks are retuned to this palette.
Version: 1.4.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: nims-casa
*/

/* Tokens lifted from the live site's Tailwind build (pine / clay / cream /
   sand / ink), so the migration is invisible to a returning reader. */
:root {
	--pine-50:  #f0f7f6;
	--pine-600: #196565;
	--pine-700: #12514f;
	--pine-800: #0f4c4c;
	--pine-900: #0a3535;
	--clay-100: #f7e8dd;
	--clay-500: #c4703f;
	--clay-600: #a95a2e;
	--clay-700: #8f4a24;
	--cream:    #faf6f0;
	--sand:     #f1e9dd;
	--ink:      #1c2b2b;
	--muted:    #5c6b6b;
	--border:   #e3d9ca;

	--font-sans: var(--font-inter), Inter, system-ui, -apple-system, sans-serif;
	--font-display: Fraunces, Georgia, 'Times New Roman', serif;

	--wrap: 1120px;
	--radius: .75rem;
}

/* Retune the plugin's blocks to this site. The plugin ships its own palette;
   everything it draws keys off these, so the blocks arrive on-brand. */
:root {
	--sc-ink:    var(--ink);
	--sc-deep:   var(--pine-800);
	--sc-accent: var(--clay-600);
	--sc-muted:  var(--muted);
	--sc-paper:  var(--sand);
	--sc-line:   var(--border);
	--sc-wrap:   var(--wrap);
	--sc-r:      var(--radius);
}
.sc-tone-light { background: var(--cream);    color: var(--ink); }
.sc-tone-paper { background: var(--sand);     color: var(--ink); }
.sc-tone-dark  { background: var(--pine-800); color: #fff; }
.sc-tone-dark .sc-stat__v { color: var(--clay-100); }
.sc-card { background: #fff; border-color: var(--border); }
.sc-btn  { color: #fff; }
.sc-hero__title, .sc-head__title, .sc-cta__title { font-family: var(--font-display); }

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


/* next/font set these on <html> in the original build; without them
   --font-sans / --font-display resolve to nothing and Inter never renders */
:root { --font-inter: Inter; --font-fraunces: Fraunces; }


.container {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: 20px;
}


/* v1.3.1: element-level defaults live in the SAME cascade layer as the legacy
   (Tailwind v4) preflight, so every utility class in imported markup
   (@layer utilities) beats them -- unlayered rules beat ALL layered rules. */
@layer base {
body {
	margin: 0;
	font-family: var(--font-sans);
	background: var(--cream);
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
}
body:not(.layout-wide) { line-height: 1.7; }
a { color: var(--pine-700); }
a:hover { color: var(--clay-600); }
img { max-width: 100%; height: auto; }
:where(body:not(.layout-wide) .entry-content) img { border-radius: var(--radius); }

:where(body:not(.layout-wide) .entry-content) > * + *{ margin-top: 1.2em; }
:where(body:not(.layout-wide) .entry-content) h1, :where(body:not(.layout-wide) .entry-content) h2, :where(body:not(.layout-wide) .entry-content) h3, :where(body:not(.layout-wide) .entry-content) h4{
	font-family: var(--font-display);
	color: var(--pine-900);
	letter-spacing: -.015em;
	margin-bottom: .45em;
}
:where(body:not(.layout-wide) .entry-content) h1{ font-size: clamp(30px, 5vw, 46px); line-height: 1.12; }
:where(body:not(.layout-wide) .entry-content) h2{ font-size: clamp(24px, 3.2vw, 32px); line-height: 1.22; margin-top: 1.9em; }
:where(body:not(.layout-wide) .entry-content) h3{ font-size: 21px; line-height: 1.3; margin-top: 1.6em; }
:where(body:not(.layout-wide) .entry-content) p{ color: #30403f; }
:where(body:not(.layout-wide) .entry-content) ul, :where(body:not(.layout-wide) .entry-content) ol{ padding-left: 1.3em; color: #30403f; }
:where(body:not(.layout-wide) .entry-content) li + li{ margin-top: .4em; }
:where(.entry-content) a{ color: inherit; text-decoration: none; }
/* accent + underline only for links inside running text; headline, card and
   image links keep the original build's styling */
:where(body:not(.layout-wide) .entry-content) p a:not([class]), :where(body:not(.layout-wide) .entry-content) li a:not([class]), :where(body:not(.layout-wide) .entry-content) td a:not([class]), :where(body:not(.layout-wide) .entry-content) blockquote a:not([class]), :where(body:not(.layout-wide) .entry-content) dd a:not([class]){ color: var(--pine-700); text-decoration: underline; text-underline-offset: 2px; }
:where(body:not(.layout-wide) .entry-content) p a:not([class]):hover, :where(body:not(.layout-wide) .entry-content) li a:not([class]):hover, :where(body:not(.layout-wide) .entry-content) td a:not([class]):hover, :where(body:not(.layout-wide) .entry-content) blockquote a:not([class]):hover{ color: var(--clay-600); }

:where(body:not(.layout-wide) .entry-content) blockquote{
	margin-inline: 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--clay-500);
	color: var(--muted);
	font-style: italic;
}

:where(body:not(.layout-wide) .entry-content) hr{ margin-block: 2.6em; border: 0; border-top: 1px solid var(--border); }

:where(body:not(.layout-wide) .entry-content) table{ width: 100%; border-collapse: collapse; font-size: 15px; }
:where(body:not(.layout-wide) .entry-content) th, :where(body:not(.layout-wide) .entry-content) td{
	padding: 10px 13px;
	border: 1px solid var(--border);
	text-align: left;
}
:where(body:not(.layout-wide) .entry-content) th{ background: var(--sand); font-family: var(--font-display); }
/* links the internal-link engine injects carry no classes: give them the
   original in-text link look, and keep them legible on dark bands */
.entry-content a.sc-autolink { color: var(--pine-700); font-weight: 500; text-decoration: underline; text-decoration-color: rgb(18 81 79 / .3); text-underline-offset: 2px; }
.entry-content :is(.bg-pine-800, .bg-pine-900, [class*="text-cream"], [class*="text-white"]) a.sc-autolink { color: inherit; text-decoration-color: currentColor; }
}


code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
pre {
	padding: 16px 18px;
	overflow-x: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--sand);
}
code { padding: 2px 6px; border-radius: 5px; background: var(--sand); }
pre code { padding: 0; background: none; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 10px 16px;
	background: var(--pine-800);
	color: #fff;
	font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

/* nav ---------------------------------------------------------------------- */

.site-nav {
	position: sticky;
	top: 0;
	z-index: 30;
	background: rgba(250, 246, 240, .9);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}
.site-nav .container {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 66px;
}
.site-nav .nm {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 20px;
	letter-spacing: -.015em;
	text-decoration: none;
	color: var(--pine-900);
	white-space: nowrap;
}
.site-nav .nm span { color: var(--clay-600); }

.site-nav ul {
	display: flex;
	align-items: center;
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-nav a {
	color: var(--muted);
	text-decoration: none;
	font-size: 14.5px;
	font-weight: 500;
}
.site-nav a:hover { color: var(--pine-800); }

.site-nav .mail {
	margin-left: auto;
	color: var(--clay-600);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}

@media (max-width: 860px) {
	.site-nav ul { display: none; }
}

/* page content ------------------------------------------------------------- */

.site-main { padding-block: 48px 76px; }

.entry-title {
	font-family: var(--font-display);
	font-size: clamp(32px, 5vw, 50px);
	line-height: 1.12;
	letter-spacing: -.02em;
	margin: 0 0 12px;
	max-width: 20ch;
	color: var(--pine-900);
}
.entry-meta { margin-bottom: 32px; color: var(--muted); font-size: 14px; }

/* a readable measure for 1,400-word guides */
.entry-content { max-width: 72ch; }
.is-home .entry-content { max-width: none; }

:where(.btn) {
	display: inline-block;
	padding: 13px 26px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: .18s;
}
.btn.primary { background: var(--pine-800); color: #fff; }
.btn.primary:hover { background: var(--pine-700); color: #fff; }
.btn.outline { border-color: var(--border); color: var(--pine-800); }
.btn:hover { transform: translateY(-1px); }

/* listings ----------------------------------------------------------------- */

.card-list {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	margin-top: 28px;
	padding: 0;
	list-style: none;
}
.card-list li {
	padding: 22px 24px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: #fff;
	transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card-list li:hover {
	border-color: var(--clay-500);
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(28, 43, 43, .07);
}
.card-list h2 {
	font-family: var(--font-display);
	margin: 0 0 8px;
	font-size: 19px;
	line-height: 1.32;
	color: var(--pine-900);
}
.card-list h2 a { text-decoration: none; color: inherit; }
.card-list p { margin: 0; color: var(--muted); font-size: 15px; }

.pagination { margin-top: 40px; display: flex; gap: 10px; flex-wrap: wrap; }
.pagination .page-numbers {
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	text-decoration: none;
	font-size: 14.5px;
}
.pagination .current { background: var(--pine-800); color: #fff; border-color: var(--pine-800); }

/* footer ------------------------------------------------------------------- */

.site-footer {
	margin-top: 64px;
	padding-block: 32px;
	border-top: 1px solid var(--border);
	background: var(--sand);
	color: var(--muted);
	font-size: 14px;
}

/* WordPress core bits ------------------------------------------------------ */

.alignwide   { max-width: 1280px; margin-inline: auto; }
.alignfull   { max-width: none; margin-inline: calc(50% - 50vw); width: 100vw; }
.aligncenter { margin-inline: auto; display: block; }
.wp-caption-text, .wp-element-caption {
	color: var(--muted);
	font-size: 13.5px;
	text-align: center;
}
.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.btn, .card-list li { transition: none; }
	.btn:hover, .card-list li:hover { transform: none; }
}

/* footer navigation (menu columns + legal links) ---------------------------- */

.footer-nav ul.menu {
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 18px 24px;
}
.footer-nav ul.menu > li > a { font-weight: 700; color: inherit; text-decoration: none; }
.footer-nav ul.sub-menu { list-style: none; margin: 8px 0 0; padding: 0; }
.footer-nav ul.sub-menu li { margin: 0 0 5px; }
.footer-nav ul.sub-menu a { color: inherit; text-decoration: none; opacity: .85; }
.footer-nav a:hover { text-decoration: underline; opacity: 1; }
.footer-legal {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	font-size: 13.5px;
}
.footer-legal a { color: inherit; text-decoration: none; }
.footer-legal a:hover { text-decoration: underline; }
.footer-mail, .footer-text { margin: 0 0 10px; }
.footer-copy { margin: 0; }

/* header items wrap between items, never inside a label */
.site-nav ul { flex-wrap: wrap; row-gap: 4px; }
.site-nav a { white-space: nowrap; }

/* v1.3.0 layout ------------------------------------------------------------ */

/* Imported pages that carry their own containers and grids lay themselves out
   exactly as on the original site: no theme width cap, no extra padding. */
.layout-wide .site-main { padding-block: 0; }
.layout-wide .site-main > .container { max-width: none; padding-inline: 0; }
.layout-wide .entry-content { max-width: none; }
.layout-wide .entry-title { max-width: var(--wrap, 1160px); margin: 36px auto 18px; padding-inline: 20px; }

/* Mobile menu: a button opens the header menu instead of hiding it. */
.nav-toggle {
	display: none;
	margin-left: 12px;
	padding: 8px 12px;
	border: 1px solid currentColor;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}
@media (max-width: 900px) {
	.site-nav .container { position: relative; flex-wrap: wrap; }
	.site-nav ul { display: none; }
	.nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
	.site-nav.open ul {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		width: 100%;
		order: 10;
		padding: 6px 0 14px;
	}
	.site-nav.open ul li { width: 100%; }
	.site-nav.open ul a { display: block; padding: 10px 2px; font-size: 16px; white-space: normal; }
}


/* v1.3.1 fixes --------------------------------------------------------------- */

/* wpautop leftovers: <p></p> inside card links, <p><!--$--><!--/$--></p> */
.entry-content p:empty { display: none; }

/* "Related reading" (Sitecraft) has no stylesheet of its own */
.sc-related { max-width: 80rem; margin: 48px auto 64px; padding-inline: 1rem; }
.sc-related__title { margin: 0 0 14px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.3; color: var(--pine-800); }
.sc-related__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 28px; margin: 0; padding: 0; list-style: none; }
.sc-related__list li { margin: 0; }
.sc-related__list a { color: var(--pine-700); font-weight: 500; text-decoration: underline; text-decoration-color: rgb(18 81 79 / .3); text-underline-offset: 2px; }
.sc-related__list a:hover { color: var(--clay-600); }

/* search form (404, empty search) */
.search-form { display: flex; gap: 10px; max-width: 480px; margin-top: 24px; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; padding: 11px 16px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font: inherit; color: var(--ink); }
.search-form .search-submit { padding: 11px 22px; border: 0; border-radius: 999px; background: var(--pine-800); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.search-form .search-submit:hover { background: var(--pine-700); }

/* logged-in: keep the sticky header below the admin bar */
.admin-bar .site-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-nav { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-nav { top: 0; } }

/* v1.4.0 ------------------------------------------------------------------- */

:root { color-scheme: light; }

/* wpautop leftovers and empty ad slots whose scripts were not migrated */
.entry-content p:empty { display: none; }
.entry-content :is(.adx, .adx-slot, [data-ad-slot], .ad-slot, .ad-rail):not(:has(iframe, img, ins, video, object)) { display: none; }

/* imported buttons keep the original build's styling */
.entry-content a.btn, .entry-content a[class*="btn"] { text-decoration: none; }
.entry-content a.sc-autolink { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* rounded corners only on bare images in plain pages */
body:not(.layout-wide) .entry-content img:not([class]) { border-radius: var(--radius, 10px); }

/* theme title on wide pages lines up with the original containers */
.entry-title { font-weight: 800; }
.layout-wide .entry-title { max-width: 80rem; margin: 2.25rem auto 1rem; padding-inline: clamp(1rem, 4vw, 2rem); }

/* "Related reading" sits in a box inside the page width */
.layout-wide .sc-related { width: calc(100% - 2 * clamp(1rem, 4vw, 2rem)); max-width: 76rem; margin: 3rem auto; }

/* search form (search page, 404) */
.search-form { display: flex; gap: 10px; max-width: 520px; margin-top: 22px; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: inherit; font: inherit; }
.search-form .search-submit { padding: 11px 20px; border: 0; border-radius: 10px; background: var(--pine-800); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.search-form .search-submit:hover { filter: brightness(1.08); }

/* logged-in: keep the sticky header below the admin bar */
@media (min-width: 783px) { .admin-bar .site-nav { top: 32px; } }
