/*
 * Nestora main stylesheet.
 * Written for the Nestora theme. Licensed under GPL-2.0-or-later, same as the theme.
 */

/* ==========================================================================
   1. Tokens, reset and base
   ========================================================================== */
:root {
	--nst-ink: #1c2a26;
	--nst-text: #4d5a55;
	--nst-muted: #6b7772;
	--nst-brand: #2c5446;
	--nst-brand-deep: #1f3e33;
	--nst-accent: #f1c04c;
	--nst-accent-deep: #d9a62d;
	--nst-paper: #f4f6f2;
	--nst-card: #ffffff;
	--nst-line: #dbe1db;
	--nst-radius: 10px;
	--nst-radius-lg: 18px;
	--nst-shadow: 0 10px 30px rgba(28, 42, 38, 0.10);
	--nst-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--nst-font);
	font-size: 1rem;
	line-height: 1.7;
	color: var(--nst-text);
	background: var(--nst-paper);
	-webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; vertical-align: middle; }
figure { margin: 0; }
a { color: var(--nst-brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--nst-brand-deep); }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .6em;
	font-weight: 700;
	line-height: 1.2;
	color: var(--nst-ink);
}
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
hr { border: 0; border-top: 1px solid var(--nst-line); margin: 2rem 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: 20px; }

/* ==========================================================================
   2. Layout helpers (written for this theme)
   ========================================================================== */
.lead { font-size: 1.15rem; }

.nst-page { padding-block: 3rem; }

/* Blog index: posts with an optional sidebar. */
.nst-layout { display: block; }
.nst-layout--sidebar { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) {
	.nst-layout--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

.nst-post { margin-bottom: 3rem; }
.nst-post .post-thumbnail { display: block; margin-bottom: 1rem; }
.nst-post__image { max-width: 100%; height: auto; }

/* ==========================================================================
   3. Buttons, forms and tables
   ========================================================================== */
.btn {
	display: inline-block;
	padding: .8rem 1.6rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: var(--nst-ink);
	background: var(--nst-accent);
	border: 2px solid var(--nst-accent);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:hover { background: var(--nst-accent-deep); border-color: var(--nst-accent-deep); color: var(--nst-ink); }

.form-control,
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="password"], input[type="number"], input[type="search"], select, textarea {
	display: block;
	width: 100%;
	padding: .65rem .9rem;
	line-height: 1.5;
	color: var(--nst-ink);
	background: #fff;
	border: 1px solid #b9c3bd;
	border-radius: var(--nst-radius);
}
textarea { min-height: 7rem; }
label { display: inline-block; margin-bottom: .35rem; font-weight: 600; color: var(--nst-ink); }
.form-group { margin-bottom: 1.1rem; }

/* ==========================================================================
   4. Header and navigation
   ========================================================================== */
.site-header { position: relative; z-index: 50; }
.nst-nav { background: var(--nst-brand-deep); color: #fff; }
.nst-nav__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 76px; }
.nst-nav__brand { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; color: #fff; text-decoration: none; }
.nst-nav__brand:hover { color: #fff; }
.nst-nav__dot { color: var(--nst-accent); }
.nst-nav__brand img { max-height: 48px; width: auto; }

.nst-nav__toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0;
	background: transparent; border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--nst-radius); cursor: pointer;
}
.nst-nav__bars, .nst-nav__bars::before, .nst-nav__bars::after {
	display: block; width: 20px; height: 2px; background: #fff; content: ""; position: relative; transition: transform .2s, background-color .2s;
}
.nst-nav__bars::before { position: absolute; top: -6px; }
.nst-nav__bars::after { position: absolute; top: 6px; }
.nst-nav__toggle[aria-expanded="true"] .nst-nav__bars { background: transparent; }
.nst-nav__toggle[aria-expanded="true"] .nst-nav__bars::before { top: 0; transform: rotate(45deg); }
.nst-nav__toggle[aria-expanded="true"] .nst-nav__bars::after { top: 0; transform: rotate(-45deg); }

.nst-nav__panel { display: none; width: 100%; padding: 0 0 1rem; }
.nst-nav__panel.is-open { display: block; }
.nst-menu { list-style: none; margin: 0; padding: 0; }
.nst-menu a { display: block; padding: .65rem 0; color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 500; }
.nst-menu a:hover, .nst-menu .current-menu-item > a, .nst-menu .current_page_item > a { color: #fff; }
.nst-menu .current-menu-item > a, .nst-menu .current_page_item > a { box-shadow: inset 0 -2px 0 var(--nst-accent); }
.nst-menu .sub-menu { list-style: none; margin: 0; padding: 0 0 0 1rem; }
.nst-menu--cta { margin-top: .5rem; border-top: 1px solid rgba(255, 255, 255, .15); }

@media (min-width: 900px) {
	.nst-nav__toggle { display: none; }
	.nst-nav__panel { display: flex !important; align-items: center; width: auto; padding: 0; flex: 1; justify-content: space-between; margin-left: 2.5rem; }
	.nst-menu { display: flex; align-items: center; gap: 1.6rem; }
	.nst-menu--main { margin-left: auto; }
	.nst-menu--cta { margin: 0 0 0 2.5rem; border: 0; }
	.nst-menu a { padding: .5rem 0; }
	.nst-menu li { position: relative; }
	.nst-menu .sub-menu {
		position: absolute; top: 100%; left: -1rem; z-index: 20; min-width: 200px; padding: .5rem 1rem;
		background: var(--nst-brand-deep); border-radius: 0 0 var(--nst-radius) var(--nst-radius);
		visibility: hidden; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s, visibility .2s;
	}
	.nst-menu li:hover > .sub-menu, .nst-menu li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: none; }
}

.home .site-main, .front-page .site-main { padding-top: 0; }

/* ==========================================================================
   5. Generic section pieces
   ========================================================================== */
.nst-section { padding-block: 4rem; }


/* ==========================================================================
   8. Footer
   ========================================================================== */
.nst-footer { padding: 4rem 0 1.5rem; color: rgba(255, 255, 255, .78); background: var(--nst-brand-deep); }
.nst-footer a { color: rgba(255, 255, 255, .85); }
.nst-footer a:hover { color: #fff; }
.nst-footer .nst-footer__brand { color: #fff; }
.nst-footer h2, .nst-footer h3, .nst-footer .widget-title { color: #fff; font-size: 1rem; }
.nst-footer__newsletter { max-width: 40rem; margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.nst-footer__newsletter .widget-title { font-size: 1.4rem; }
.nst-footer__main { display: grid; gap: 2.5rem; margin-bottom: 3rem; }
.nst-footer__brand { font-size: 1.6rem; font-weight: 700; color: #fff; text-decoration: none; }
.nst-footer__about p { margin: 1rem 0 1.25rem; max-width: 26rem; }
.nst-footer__widgets { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.nst-footer__widgets ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.nst-footer__widgets .widget { min-width: 0; }
.nst-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .92rem; }
.nst-footer__bottom p { margin: 0; }
.nst-footer__menu { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 992px) { .nst-footer__main { grid-template-columns: 4fr 8fr; gap: 4rem; } }

/* ==========================================================================
   9. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   10. Search form, 404, archives, search results and shop archive
   ========================================================================== */
.search-form { display: flex; gap: .5rem; max-width: 34rem; margin-bottom: 1.5rem; }
.search-form label { flex: 1; min-width: 0; margin: 0; }
.search-form .search-field { width: 100%; }
.search-form .search-submit {
	padding: .65rem 1.3rem; font-weight: 600; color: #fff; background: var(--nst-ink);
	border: 2px solid var(--nst-ink); border-radius: 999px; cursor: pointer; transition: background-color .2s;
}
.search-form .search-submit:hover { background: var(--nst-brand); border-color: var(--nst-brand); }

.nestora-404-header { padding: 4rem 0 3rem; color: rgba(255, 255, 255, .82); text-align: center; background: linear-gradient(135deg, var(--nst-brand), var(--nst-brand-deep)); }
.nestora-404-header h1 { color: #fff; }
.nestora-404-header p { max-width: 36rem; margin: 0 auto; }
.nestora-404-body { padding: 3rem 0 5rem; }
.nestora-404-grid { max-width: 40rem; margin-inline: auto; }
.nestora-404-grid .search-form { margin-inline: 0; }
.nestora-404-section .actions { list-style: none; margin: 0; padding: 0; }
.nestora-btn { display: inline-block; padding: .8rem 1.6rem; font-weight: 600; color: var(--nst-ink); text-decoration: none; background: var(--nst-accent); border-radius: 999px; transition: background-color .2s; }
.nestora-btn:hover { background: var(--nst-accent-deep); color: var(--nst-ink); }

.nestora-category, .nestora-search, .nestora-shop { padding-bottom: 4rem; }
.page-header { margin-bottom: 2rem; }
.page-title { margin-bottom: .5rem; }
.archive-description { max-width: 46rem; color: var(--nst-muted); }

.posts-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: var(--nst-radius-lg); box-shadow: 0 2px 10px rgba(28, 42, 38, .06); }
.post-card__thumb { display: block; overflow: hidden; }
.post-card__thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.04); }
.post-card__body { display: flex; flex: 1; flex-direction: column; padding: 1.25rem 1.4rem 1.5rem; }
.post-card__title { margin-bottom: .4rem; font-size: 1.25rem; }
.post-card__title a { color: var(--nst-ink); text-decoration: none; }
.post-card__title a:hover { text-decoration: underline; }
.post-card__meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: .75rem; font-size: .88rem; color: var(--nst-muted); }
.post-card__excerpt { margin-bottom: 1rem; }
.post-card__excerpt p:last-child { margin-bottom: 0; }
.post-card__more { align-self: flex-start; margin-top: auto; font-weight: 600; color: var(--nst-ink); text-decoration-color: var(--nst-accent); text-decoration-thickness: 2px; }
.no-posts { padding: 2rem 0; }

.search-result { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--nst-line); }
.search-result__inner { display: grid; gap: 1rem 1.5rem; align-items: center; }
@media (min-width: 768px) {
	.search-result__inner:has(.search-result__media) { grid-template-columns: 1fr 2fr; }
}
.search-result .entry-title { font-size: 1.4rem; }
.search-result .entry-title a { color: var(--nst-ink); text-decoration: none; }
.search-result .entry-title a:hover { text-decoration: underline; }
.entry-meta { font-size: .9rem; color: var(--nst-muted); }
.read-more { font-weight: 600; }

.pagination, .navigation.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.pagination .page-numbers { display: inline-block; min-width: 42px; padding: .5rem .9rem; text-align: center; text-decoration: none; color: var(--nst-ink); background: #fff; border: 1px solid var(--nst-line); border-radius: var(--nst-radius); }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { color: #fff; background: var(--nst-ink); border-color: var(--nst-ink); }

/* ==========================================================================
   11. Block patterns (front page and any other page or post)
   ========================================================================== */
.nst-section .wp-block-columns,
.nst-pattern-hero .wp-block-columns { gap: 2rem; }
.nst-section .wp-block-image img,
.nst-pattern-hero .wp-block-image img { border-radius: var(--nst-radius-lg); }
.nst-pattern-icon img { width: 48px; height: 48px; }
.nst-pattern-hero { padding-block: 4rem; }
.nst-pattern-hero .wp-block-columns { align-items: center; }
