/* ============================================================
   MAISON NOIR — ARTICLE STYLES
   ============================================================ */


/* ============================================================
   ARTICLE HERO
   ============================================================ */

.article-hero {
	position: relative;
	min-height: 70vh;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	text-align: center;
	overflow: hidden;
}

.article-hero__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 1;
}

.article-hero__bg--fallback {
	background-color: #2c2823;
}

.article-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.2) 0%,
		rgba(0, 0, 0, 0.5) 60%,
		rgba(0, 0, 0, 0.85) 100%
	);
	z-index: 2;
}

.article-hero__content {
	position: relative;
	z-index: 3;
	padding: 2rem 4rem 3rem;
	max-width: 850px;
	margin: 0 auto;
	color: #fff;
}

.article-hero .eyebrow {
	display: block;
	margin-bottom: 1.2rem;
	font-size: 0.7rem;
	letter-spacing: 0.4em;
	text-transform: uppercase;
	color: var(--gold-light);
}

.article-hero .article-title {
	margin-bottom: 1.2rem;
	font-family: "Cormorant Garamond", serif;
	font-size: clamp(2.5rem, 6vw, 4.5rem);
	font-weight: 400;
	line-height: 1.15;
	color: #fff;
}

.article-hero .article-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.8);
}

.article-hero .article-meta a {
	color: #fff;
	text-decoration: none;
	border-bottom: 1px solid var(--gold-light);
}


/* ============================================================
   ARTICLE SHARE ACTIONS
   ============================================================ */

.article-hero .article-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.8rem;
	margin-top: 1.5rem;
}

.action-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1.2rem;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 50px;
	color: #fff;
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition:
		background 0.3s ease,
		color 0.3s ease,
		border-color 0.3s ease,
		transform 0.2s ease;
}

.action-btn:hover,
.action-btn:focus-visible {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--ivory);
}

.action-btn:active {
	transform: translateY(1px);
}

.action-btn svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.action-btn span {
	white-space: nowrap;
}


/* ============================================================
   COPY FEEDBACK
   ============================================================ */

.copy-feedback {
	margin-left: 0.5rem;
	font-size: 0.7rem;
	color: var(--gold-light);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.copy-feedback.show {
	opacity: 1;
}


/* ============================================================
   BOTTOM ARTICLE SHARING
   ============================================================ */

.article-bottom-share {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--line);
	text-align: center;
}

.bottom-share-label {
	display: block;
	margin-bottom: 1rem;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--muted);
}

.article-bottom-share .bottom-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.8rem;
}

.article-bottom-share .action-btn {
	border-color: var(--line);
	color: var(--dark);
}

.article-bottom-share .action-btn:hover,
.article-bottom-share .action-btn:focus-visible {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--ivory);
}


/* ============================================================
   ARTICLE LAYOUT
   ============================================================ */

.article-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 4rem;
	max-width: 1200px;
	margin: 0 auto;
	padding: 4rem 2rem;
}

.article-layout__main {
	min-width: 0;
}

.article-layout__sidebar {
	position: sticky;
	top: 100px;
	height: fit-content;
}

.mobile-toc {
	display: none;
}


/* ============================================================
   ARTICLE CONTENT
   ============================================================ */

.article-content {
	font-size: 1.05rem;
	line-height: 1.8;
	color: #3e3a34;
}

.article-content p {
	margin-bottom: 1.6rem;
}

.article-content ul,
.article-content ol {
	margin: 0 0 1.6rem 2rem;
}

.article-content li {
	margin-bottom: 0.4rem;
}

.article-content h2 {
	margin: 2.8rem 0 1.2rem;
	font-family: "Cormorant Garamond", serif;
	font-size: 2rem;
	font-weight: 400;
	line-height: 1.25;
	color: var(--dark);
	scroll-margin-top: 100px;
}

.article-content h3 {
	margin: 2rem 0 1rem;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.4rem;
	font-weight: 400;
	line-height: 1.3;
	color: var(--dark);
	scroll-margin-top: 100px;
}

.article-content img {
	width: 100%;
	height: auto;
	margin: 2rem 0;
	border-radius: 4px;
}

.article-content blockquote {
	max-width: 90%;
	margin: 3rem 0;
	padding-left: 2rem;
	border-left: 3px solid var(--gold);
	font-family: "Cormorant Garamond", serif;
	font-size: 2rem;
	font-style: italic;
	line-height: 1.4;
	color: var(--dark);
}


/* ============================================================
   ARTICLE TAGS
   ============================================================ */

.article-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	margin-top: 2rem;
}

.article-tag {
	display: inline-block;
	padding: 0.3rem 1rem;
	background: var(--ivory);
	border: 1px solid var(--line);
	border-radius: 50px;
	color: var(--muted);
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-decoration: none;
	text-transform: uppercase;
	transition:
		background 0.3s ease,
		color 0.3s ease,
		border-color 0.3s ease;
}

.article-tag:hover,
.article-tag:focus-visible {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--ivory);
}


/* ============================================================
   AUTHOR BOX — RESPONSIVE
   ============================================================ */

.author-box {
	position: relative;
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	align-items: start;
	column-gap: 1.25rem;
	row-gap: 1rem;

	width: 100%;
	max-width: 100%;

	margin-top: 3rem;
	padding: 1.75rem;

	background: var(--ivory);
	border: 1px solid var(--line);
	border-radius: 6px;

	box-sizing: border-box;
}

.author-box__avatar-link {
	display: block;
	width: 72px;
	height: 72px;
	flex-shrink: 0;
}

.author-box__avatar {
	display: block;
	width: 72px;
	height: 72px;
	max-width: 100%;

	border: 2px solid var(--gold);
	border-radius: 50%;

	object-fit: cover;
}

.author-box__body {
	min-width: 0;
	width: 100%;
}

.author-box__name-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.45rem 0.9rem;
	margin: 0;
}

.author-box__name {
	display: inline-block;

	font-family: "Cormorant Garamond", serif;
	font-size: 1.35rem;
	line-height: 1.2;

	color: var(--dark);
	text-decoration: none;
}

.author-box__title {
	display: inline-block;

	font-size: 0.68rem;
	line-height: 1.4;
	letter-spacing: 0.16em;
	text-transform: uppercase;

	color: var(--gold);
}

.author-box__bio {
	margin: 0.5rem 0 0.85rem;

	font-size: 0.82rem;
	line-height: 1.65;

	color: var(--muted);

	overflow-wrap: anywhere;
	word-break: normal;
}

.author-box__socials {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7rem;

	margin: 0;
}

.author-box__socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 28px;
	height: 28px;

	color: var(--dark);

	text-decoration: none;

	transition: color 0.2s ease;
}

.author-box__socials a:hover,
.author-box__socials a:focus-visible {
	color: var(--gold);
}

.author-box__view-profile {
	display: inline-flex;
	align-items: center;

	width: fit-content;
	max-width: 100%;

	margin-top: 0.75rem;
	padding: 0 0 3px;

	border: 0;
	border-bottom: 1px solid var(--gold);

	background: transparent;

	color: var(--gold);

	font-size: 0.72rem;
	line-height: 1.4;
	text-decoration: none;

	cursor: pointer;
}

.author-box__view-profile:hover,
.author-box__view-profile:focus-visible {
	color: var(--dark);
	border-bottom-color: var(--dark);
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 900px) {

	.author-box {
		grid-template-columns: 64px minmax(0, 1fr);
		column-gap: 1rem;

		padding: 1.4rem;
	}

	.author-box__avatar-link,
	.author-box__avatar {
		width: 64px;
		height: 64px;
	}
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 640px) {

	.author-box {
		display: grid;

		grid-template-columns: 56px minmax(0, 1fr);

		column-gap: 0.9rem;
		row-gap: 0.75rem;

		width: 100%;
		max-width: 100%;

		margin-top: 2.5rem;
		padding: 1.1rem;

		overflow: visible;
	}

	.author-box__avatar-link,
	.author-box__avatar {
		width: 56px;
		height: 56px;
	}

	.author-box__name {
		font-size: 1.2rem;
	}

	.author-box__title {
		font-size: 0.62rem;
	}

	.author-box__bio {
		margin-top: 0.45rem;

		font-size: 0.78rem;
		line-height: 1.6;
	}

	.author-box__socials {
		gap: 0.45rem;
	}

	.author-box__socials a {
		width: 26px;
		height: 26px;
	}

	.author-box__view-profile {
		margin-top: 0.65rem;
		font-size: 0.68rem;
	}

}


/* ============================================================
   SMALL PHONES
   ============================================================ */

@media (max-width: 400px) {

	.author-box {
		grid-template-columns: 48px minmax(0, 1fr);

		column-gap: 0.75rem;

		padding: 0.95rem;
	}

	.author-box__avatar-link,
	.author-box__avatar {
		width: 48px;
		height: 48px;
	}

	.author-box__name {
		font-size: 1.1rem;
	}

	.author-box__bio {
		font-size: 0.75rem;
		line-height: 1.55;
	}
}

/* ============================================================
   RELATED POSTS
   ============================================================ */

.related-posts {
	max-width: 1200px;
	margin: 4rem auto;
	padding: 0 2rem;
}

.related-posts .section-subheading {
	margin-bottom: 2rem;
	font-family: "Cormorant Garamond", serif;
	font-size: 2rem;
}

.related-scroll {
	position: relative;
}

.related-cards {
	display: flex;
	gap: 2rem;
	overflow-x: auto;
	padding-bottom: 1rem;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.related-cards > * {
	min-width: 280px;
	flex-shrink: 0;
	scroll-snap-align: start;
}

.related-scroll-btn {
	position: absolute;
	top: 50%;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 40px;
	height: 40px;

	padding: 0;

	background: var(--ivory);
	border: 1px solid var(--line);
	border-radius: 50%;

	cursor: pointer;

	opacity: 0.8;

	transform: translateY(-50%);

	transition:
		opacity 0.3s ease,
		background 0.3s ease;
	z-index: 5;
}

.related-scroll-btn--prev {
	left: -20px;
}

.related-scroll-btn--next {
	right: -20px;
}

.related-scroll-btn:hover,
.related-scroll-btn:focus-visible {
	opacity: 1;
	background: #fff;
}


/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */

.toc-widget {
	margin-bottom: 2rem;
	padding: 1rem 1.2rem;
	background: var(--ivory);
	border: 1px solid var(--line);
	border-radius: 4px;
}

.toc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--dark);
	cursor: pointer;
	text-align: left;
}

.toc-title {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.toc-chevron {
	flex-shrink: 0;
	transition: transform 0.25s ease;
}

.toc-header[aria-expanded="false"] .toc-chevron {
	transform: rotate(-90deg);
}

.toc-list {
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.toc-list li {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--line);
}

.toc-list li:last-child {
	border-bottom: 0;
}

.toc-list a {
	display: block;
	padding: 0.7rem 0;
	color: var(--muted);
	font-size: 0.85rem;
	line-height: 1.4;
	text-decoration: none;
	transition: color 0.2s ease;
}

.toc-list a:hover,
.toc-list a:focus-visible {
	color: var(--gold);
}


/* ============================================================
   VERDICT BOX
   ============================================================ */

.verdict-box {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin: 2rem 0;
	padding: 1.5rem;
	background: var(--ivory);
	border: 1px solid var(--line);
	border-left: 3px solid var(--gold);
}

.verdict-box__score {
	flex-shrink: 0;
	font-family: "Cormorant Garamond", serif;
	font-size: 2.5rem;
	line-height: 1;
	color: var(--dark);
}

.verdict-box__score .text-muted {
	font-family: inherit;
	font-size: 1rem;
	color: var(--muted);
}

.verdict-box__content {
	flex: 1;
}

.verdict-box__content p:last-child {
	margin-bottom: 0;
}


/* ============================================================
   AT-A-GLANCE TABLE
   ============================================================ */

.at-a-glance {
	width: 100%;
	margin: 2rem 0;
	border-collapse: collapse;
	background: var(--ivory);
	border: 1px solid var(--line);
}

.at-a-glance th,
.at-a-glance td {
	padding: 0.8rem 1rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.at-a-glance tr:last-child th,
.at-a-glance tr:last-child td {
	border-bottom: 0;
}

.at-a-glance th {
	width: 35%;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dark);
}

.at-a-glance td {
	font-size: 0.9rem;
	color: var(--muted);
}


/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */

@media (max-width: 1024px) {

	.article-layout {
		grid-template-columns: 1fr;
		padding: 3rem 1.5rem;
	}

	.article-layout__sidebar {
		position: static;
		margin-top: 2rem;
	}

	.mobile-toc {
		display: block;
		margin-bottom: 2rem;
	}

	.toc-in-sidebar {
		display: none;
	}

	/*
	 * The tooltip remains a local popover on tablet.
	 * It does NOT become a fixed drawer.
	 */
	.author-tooltip {
		left: calc(100% + 12px);
	}
}


/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media (max-width: 768px) {

	.article-hero {
		min-height: 55vh;
	}

	.article-hero__content {
		padding: 2rem 1.5rem 3rem;
	}

	.article-hero .article-title {
		font-size: clamp(2.2rem, 10vw, 3.4rem);
	}

	.article-hero .article-meta {
		gap: 0.6rem;
		font-size: 0.65rem;
	}

	.article-hero .article-actions {
		gap: 0.55rem;
	}

	.action-btn {
		padding: 0.5rem 0.8rem;
	}

	.article-content {
		font-size: 1rem;
	}

	.article-content h2 {
		font-size: 1.8rem;
	}

	.article-content h3 {
		font-size: 1.3rem;
	}

	.article-content blockquote {
		max-width: 100%;
		padding-left: 1.25rem;
		font-size: 1.6rem;
	}

	.author-box {
		align-items: flex-start;
		padding: 1.4rem;
		gap: 1rem;
	}

	.author-box__avatar {
		width: 60px;
		height: 60px;
	}

	.author-box__name-row {
		gap: 0.5rem;
	}

	/*
	 * On mobile the popover moves below the author content.
	 * It is still attached to the author box and NEVER becomes
	 * a fixed bottom drawer.
	 */
	.author-tooltip {
		left: 0;
		right: auto;
		bottom: auto;
		top: calc(100% + 10px);

		width: min(300px, calc(100vw - 3rem));

		transform: translateY(-6px);
	}

	.author-tooltip.show {
		transform: translateY(0);
	}

	.author-tooltip::before {
		left: 22px;
		top: -7px;
		bottom: auto;

		border-top: 1px solid rgba(255, 255, 255, 0.08);
		border-right: 1px solid rgba(255, 255, 255, 0.08);
		border-left: 0;
		border-bottom: 0;
	}

	.related-cards {
		gap: 1rem;
	}

	.related-cards > * {
		min-width: 240px;
	}

	.related-scroll-btn {
		display: none;
	}

	.article-bottom-share .bottom-actions {
		gap: 0.5rem;
	}

	.verdict-box {
		align-items: flex-start;
	}

	.at-a-glance th,
	.at-a-glance td {
		padding: 0.7rem;
	}
}


/* ============================================================
   VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 480px) {

	.article-hero__content {
		padding-right: 1rem;
		padding-left: 1rem;
	}

	.article-hero .article-actions {
		justify-content: flex-start;
	}

	.article-hero .action-btn {
		padding: 0.45rem 0.65rem;
	}

	.article-hero .action-btn span {
		display: none;
	}

	.article-layout {
		padding-right: 1rem;
		padding-left: 1rem;
	}

	.author-box {
		padding: 1.15rem;
	}

	.author-box__avatar {
		width: 54px;
		height: 54px;
	}

	.author-tooltip {
		width: calc(100vw - 2rem);
	}

	.related-posts {
		padding-right: 1rem;
		padding-left: 1rem;
	}

	.verdict-box {
		flex-direction: column;
	}

	.at-a-glance {
		font-size: 0.85rem;
	}

	.at-a-glance th {
		width: 40%;
	}
}
.toc-list {
        overflow: hidden;
        max-height: 2000px;
        opacity: 1;
        transition:
                max-height 0.3s ease,
                opacity 0.25s ease,
                margin-top 0.25s ease;
}

.toc-list:not(.open) {
        max-height: 0;
        opacity: 0;
        margin-top: 0;
        pointer-events: none;
}

/* ========== Related Posts (Grid) ========== */
.related-posts {
	margin-top: 5rem;
	padding: 4rem 0 6rem;
	border-top: 1px solid var(--line, #e6e2db);
}
.related-posts .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 2rem;
}
.related-posts .section-heading {
	text-align: center;
	margin-bottom: 2.5rem;
}
.related-posts .section-heading .eyebrow {
	font-size: 0.7rem;
	letter-spacing: 0.4em;
	text-transform: uppercase;
	color: var(--gold);
	display: block;
	margin-bottom: 0.5rem;
}
.related-posts .section-heading h2 {
	font-family: 'Cormorant Garamond', serif;
	font-size: 2rem;
	font-weight: 400;
	color: var(--dark);
	margin: 0;
}

.related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 2rem;
	align-items: stretch;
}

/* Force equal heights and clamp images */
.related-grid .post-card,
.related-grid .perfume-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.related-grid .post-card__thumb,
.related-grid .perfume-card__thumb {
	aspect-ratio: 4 / 5;
	width: 100%;
	overflow: hidden;
	background: var(--cream, #f4f1ea);
}
.related-grid .post-card__thumb img,
.related-grid .perfume-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.related-posts .container {
		padding: 0 1.5rem;
	}
	.related-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
}
