/*
 Theme Name:   Story Light
 Theme URI:    https://danbistore.com/product/media-starterpack-light/↗
 Description:  Default GeneratePress child theme
 Author:       DANBI Labs Inc.
 Author URI:   https://danbilabs.com
 Template:     generatepress
 Version:      1.0
*/

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

/* Story Light — toss.tech style. Managed by the gp-child-theme skill.
 * Covers what the GP Free Customizer and Enhance for GeneratePress cannot express:
 * card grid for list items, badges, pill navigation, rounded sidebar cards, home hero. */

/* Korean text breaks between words, like toss.tech. */
body {
	word-break: keep-all;
	overflow-wrap: break-word;
}

/* ---------- Header ---------- */
.site-header .inside-header {
	padding: 0.625rem 0;
}

.site-header .main-title a {
	text-decoration: none;
}

.site-header .main-navigation .main-nav > ul {
	align-items: center;
	gap: 0.375rem;
}

.site-header .main-navigation .main-nav ul li a {
	padding: 0.5625rem 0.75rem;
	line-height: 1.375rem;
	border-radius: 5px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.site-header .main-navigation .menu-bar-items .menu-bar-item > a {
	padding: 0.5625rem 0.75rem;
	line-height: 1.375rem;
	border-radius: 5px;
}

.site-header .main-navigation .menu-bar-items .menu-bar-item > a:hover {
	background-color: var(--base-20);
}

/* ---------- Header search input (shown when the search icon is clicked) ---------- */
.main-navigation .navigation-search input[type="search"] {
	border: 1px solid var(--contrast-50);
	border-radius: 5px;
}

/* GP turns on a browser focus ring whenever the search is open (selector with an ID); match it so the border is the indicator. */
.has-inline-mobile-toggle #site-navigation.has-active-search .navigation-search input[type="search"] {
	outline: 0;
}

.has-inline-mobile-toggle #site-navigation.has-active-search .navigation-search input[type="search"]:focus {
	border-color: var(--contrast-10);
}

/* ---------- Home hero: the newest post, shown large (CSS only, no PHP) ----------
 * On the first page of the blog home, .site-content becomes a grid so the first article can span
 * the full width above the list while the sidebar stays on the right under it. */
.home.blog:not(.paged) .site-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 19.5rem;
	column-gap: 4.5rem;
	align-items: start;
}

.home.blog:not(.paged) .content-area,
.home.blog:not(.paged) .site-main {
	display: contents;
}

.home.blog:not(.paged) .site-main > * {
	grid-column: 1;
}

.home.blog:not(.paged) #right-sidebar {
	grid-column: 2;
	grid-row: 2 / span 30;
	width: auto;
}

.home.blog:not(.paged) .site-main > article.post:first-of-type {
	grid-column: 1 / -1;
	grid-row: 1;
	margin-top: 1rem;
	margin-bottom: 3.5rem;
	padding-bottom: 0;
	border-bottom: 0;
}

.home.blog:not(.paged) .site-main > article.post:first-of-type .inside-article {
	grid-template-columns: minmax(0, 1fr) 32.5rem;
	grid-template-areas:
		"cat thumb"
		"title thumb"
		"excerpt thumb";
	grid-template-rows: auto auto auto;
	align-content: center;
	column-gap: 3rem;
}

/* The hero grid has no "author" area; the empty author meta would add two extra columns. */
.home.blog:not(.paged) .site-main > article.post:first-of-type .entry-header .entry-meta {
	display: none;
}

.home.blog:not(.paged) .site-main > article.post:first-of-type .entry-title {
	margin: 0.75rem 0 1rem;
	font-size: 2.25rem;
	line-height: 1.35;
}

.home.blog:not(.paged) .site-main > article.post:first-of-type .entry-summary p {
	font-size: 1.0625rem;
}

.home.blog:not(.paged) .site-main > article.post:first-of-type .post-image {
	margin-left: 0;
}

.home.blog:not(.paged) .site-main > article.post:first-of-type .post-image img {
	aspect-ratio: 520 / 280;
}

/* ---------- Content layout (one container, 1024px) ---------- */
.one-container .site-content {
	padding: 1.5rem 0 0;
}

.one-container.right-sidebar .site-main {
	margin-right: 4.5rem;
}

.archive-heading {
	margin-bottom: 3.25rem;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.4;
	color: var(--contrast-20);
}

.archive .page-header {
	margin-bottom: 3.25rem;
}

.archive .page-header .page-title {
	font-size: 2rem;
	color: var(--contrast-20);
}

/* ---------- Article list: badges, title, excerpt, thumbnail on the right ---------- */
/* (0,5,1) beats GP's .one-container.blog .post:not(:last-child):not(.is-loop-template-item) (0,5,0) bottom padding. */
.blog.one-container .site-main > article.post:not(.is-loop-template-item),
.archive.one-container .site-main > article.post:not(.is-loop-template-item),
.search.one-container .site-main > article.post:not(.is-loop-template-item) {
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--base-10);
}

/* No divider after the last post in the list. */
.blog.one-container .site-main > article.post:not(.is-loop-template-item):last-of-type,
.archive.one-container .site-main > article.post:not(.is-loop-template-item):last-of-type,
.search.one-container .site-main > article.post:not(.is-loop-template-item):last-of-type {
	padding-bottom: 0;
	border-bottom: 0;
}

.blog .site-main .inside-article,
.archive .site-main .inside-article,
.search .site-main .inside-article {
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr) 15.75rem;
	grid-template-areas:
		"cat author . thumb"
		"title title title thumb"
		"excerpt excerpt excerpt thumb";
	grid-template-rows: auto auto 1fr;
	column-gap: 0.5rem;
	align-items: start;
	padding: 0;
}

.blog .inside-article > .entry-header,
.archive .inside-article > .entry-header,
.search .inside-article > .entry-header {
	display: contents;
}

.blog .inside-article .entry-title,
.archive .inside-article .entry-title,
.search .inside-article .entry-title {
	grid-area: title;
	margin: 0.75rem 0 0.5rem;
}

.blog .inside-article .entry-title a,
.archive .inside-article .entry-title a,
.search .inside-article .entry-title a {
	text-decoration: none;
}

.blog .inside-article .entry-header .entry-meta,
.archive .inside-article .entry-header .entry-meta,
.search .inside-article .entry-header .entry-meta {
	grid-area: author;
	margin: 0;
}

.blog .inside-article > footer.entry-meta,
.archive .inside-article > footer.entry-meta,
.search .inside-article > footer.entry-meta {
	grid-area: cat;
	margin: 0;
}

.blog .inside-article > .post-image,
.archive .inside-article > .post-image,
.search .inside-article > .post-image {
	grid-area: thumb;
	align-self: center;
	margin: 0 0 0 1.5rem;
}

.blog .inside-article > .post-image img,
.archive .inside-article > .post-image img,
.search .inside-article > .post-image img {
	display: block;
	width: 100%;
	aspect-ratio: 228 / 128;
	object-fit: cover;
	border-radius: 8px;
}

.blog .inside-article > .entry-summary,
.archive .inside-article > .entry-summary,
.search .inside-article > .entry-summary {
	grid-area: excerpt;
	margin: 0;
}

.blog .inside-article > .entry-summary p,
.archive .inside-article > .entry-summary p,
.search .inside-article > .entry-summary p {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--contrast-30);
}

/* Category and author badges (listings and single posts). */
.entry-meta .cat-links .gp-icon,
.entry-meta .tags-links .gp-icon {
	display: none;
}

.entry-meta .cat-links a,
.entry-meta .byline .author a {
	display: inline-block;
	padding: 0.125rem 0.625rem;
	border-radius: 4px;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.6;
	text-decoration: none;
}

.entry-meta .cat-links a {
	background-color: var(--accent-30);
	color: var(--contrast-10);
}

.entry-meta .byline {
	font-size: 0;
}

.entry-meta .byline .author a {
	background-color: var(--base-20);
	color: var(--contrast-30);
}

/* ---------- Pagination ---------- */
.paging-navigation .nav-links {
	display: flex;
	justify-content: center;
	gap: 0.25rem;
}

.paging-navigation .page-numbers {
	min-width: 2.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 5px;
	font-size: 0.9375rem;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	color: var(--contrast-30);
}

.paging-navigation .page-numbers.current,
.paging-navigation a.page-numbers:hover {
	background-color: var(--base-20);
	color: var(--contrast-10);
}

/* ---------- Sidebar cards ---------- */
.one-container .inside-right-sidebar .widget {
	margin-bottom: 1.5rem;
	padding: 1.75rem 1.5rem;
	border-radius: 12px;
}

.inside-right-sidebar .widget .wp-block-heading {
	margin-bottom: 1rem;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.6;
	color: var(--contrast-30);
}

.inside-right-sidebar .wp-block-latest-posts,
.inside-right-sidebar .wp-block-latest-comments {
	margin: 0;
	padding: 0;
}

.inside-right-sidebar .wp-block-latest-posts li,
.inside-right-sidebar .wp-block-latest-comments__comment {
	margin-bottom: 0.75rem;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.6;
}

.inside-right-sidebar .wp-block-latest-posts li:last-child,
.inside-right-sidebar .wp-block-latest-comments__comment:last-child {
	margin-bottom: 0;
}

.inside-right-sidebar .widget a {
	text-decoration: none;
}

/* ---------- Sidebar: sticky while scrolling (desktop) ---------- */
.inside-right-sidebar {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.5rem);
}

/* On the home grid the sidebar is a grid item; let it stretch so the inner box has room to stick. */
.home.blog:not(.paged) #right-sidebar {
	align-self: stretch;
}

/* ---------- Single post ---------- */
.single .inside-article {
	padding: 0;
}

.single .entry-header .entry-meta {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	margin-top: 1.5rem;
}

/* Author first, then the date (the author is a plain name here, not a badge). */
.single .entry-header .entry-meta .byline {
	order: -1;
}

.single .entry-header .entry-meta .byline .author a {
	padding: 0;
	border-radius: 0;
	background: none;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.6;
	color: var(--contrast-20);
}

.single .entry-header .entry-meta .posted-on {
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--contrast-30);
}

.single .entry-content {
	margin-top: 2.5rem;
	font-size: 1.0625rem;
	line-height: 1.6;
}

.single .entry-content p {
	margin: 1.5rem 0 0.5rem;
}

.single .entry-content > :first-child {
	margin-top: 0;
}

.single .entry-content :is(ul, ol) {
	margin: 1.5rem 0 0.5rem;
	padding-left: 1.5rem;
}

.single .entry-content li {
	margin-bottom: 1rem;
}

.single .entry-content li:last-child {
	margin-bottom: 0;
}

.single .entry-content h2 {
	margin-top: 2.5rem;
}

.single .entry-content h3 {
	margin-top: 1.5rem;
}

.single .entry-content figure {
	margin: 1.5rem 0 0.5rem;
}

.single .entry-content figcaption {
	margin-top: 0.375rem;
	font-size: 0.9375rem;
	color: var(--contrast-30);
}

.single .entry-content img {
	border-radius: 8px;
}

.single .entry-content :not(pre) > code {
	padding: 0.125rem 0.375rem;
	border: 1px solid var(--base-10);
	border-radius: 2px;
	background-color: var(--base-20);
	font-size: 0.9em;
}

.single .featured-image img,
.single .post-image img {
	border-radius: 8px;
}

/* ---------- Footer ---------- */
.site-info .inside-site-info {
	padding: 3.125rem 0 4rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1239px) {
	.site-header .inside-header,
	.one-container .site-content,
	.site-info .inside-site-info {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}
}

@media (max-width: 768px) {
	.inside-right-sidebar {
		position: static;
	}

	.home.blog:not(.paged) .site-content {
		grid-template-columns: minmax(0, 1fr);
	}

	.home.blog:not(.paged) #right-sidebar {
		grid-column: 1;
		grid-row: auto;
	}

	.home.blog:not(.paged) .site-main > article.post:first-of-type {
		margin-bottom: 2.5rem;
	}

	.home.blog:not(.paged) .site-main > article.post:first-of-type .inside-article {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"thumb"
			"cat"
			"title"
			"excerpt";
		row-gap: 0;
	}

	.home.blog:not(.paged) .site-main > article.post:first-of-type .post-image {
		margin-bottom: 1.25rem;
	}

	.home.blog:not(.paged) .site-main > article.post:first-of-type .entry-title {
		font-size: 1.625rem;
	}

	.one-container.right-sidebar .site-main {
		margin-right: 0;
	}

	.archive-heading {
		margin-bottom: 2rem;
		font-size: 1.5rem;
	}

	.blog .site-main .inside-article,
	.archive .site-main .inside-article,
	.search .site-main .inside-article {
		grid-template-columns: auto auto minmax(0, 1fr) 8.5rem;
	}

	.blog .inside-article > .post-image,
	.archive .inside-article > .post-image,
	.search .inside-article > .post-image {
		margin-left: 1rem;
	}

	.blog.one-container .site-main > article.post:not(.is-loop-template-item),
	.archive.one-container .site-main > article.post:not(.is-loop-template-item),
	.search.one-container .site-main > article.post:not(.is-loop-template-item) {
		margin-bottom: 1.5rem;
		padding-bottom: 1.5rem;
	}
}

/* ---------- Mobile: hide excerpts in lists (the home hero keeps its summary) ---------- */
@media (max-width: 768px) {
	.blog .inside-article > .entry-summary,
	.archive .inside-article > .entry-summary,
	.search .inside-article > .entry-summary {
		display: none;
	}

	.home.blog:not(.paged) .site-main > article.post:first-of-type .inside-article > .entry-summary {
		display: block;
	}
}

/* ---------- Newsletter subscribe form (widget HTML, modeled on Stibee's form) ---------- */
.newsletter-form__desc {
	margin-bottom: 1rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--contrast-30);
}

.newsletter-form__label {
	display: block;
	margin-bottom: 0.375rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--contrast-20);
}

.newsletter-form__label span {
	color: var(--contrast-30);
}

.newsletter-form .newsletter-form__input {
	display: block;
	width: 100%;
	margin-bottom: 0.75rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--base-10);
	border-radius: 5px;
	background-color: var(--base-30);
	font-size: 0.9375rem;
	color: var(--contrast-10);
}

.newsletter-form .newsletter-form__input:focus {
	border-color: var(--contrast-50);
	outline: none;
}

.newsletter-form__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin-bottom: 1rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--contrast-30);
	cursor: pointer;
}

.newsletter-form__consent input {
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	margin: 0.125rem 0 0;
	accent-color: var(--contrast-10);
}

.newsletter-form__button {
	display: block;
	width: 100%;
	padding: 0.75rem 1rem;
	border: 0;
	border-radius: 5px;
	background-color: var(--accent-20);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--contrast-10);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.newsletter-form__button:is(:hover, :focus) {
	background-color: var(--accent-10);
	color: var(--contrast-10);
}

.newsletter-form__message {
	margin: 0.75rem 0 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--contrast-10);
}

.newsletter-form__message.is-error {
	color: var(--contrast-30);
}

/* ---------- Article body: quotes and headings (Story Light) ---------- */
.single .entry-content blockquote {
	margin: 2.5rem 0;
	padding: 1.5rem 1.75rem;
	border-left: 4px solid var(--accent-20);
	border-radius: 5px;
	background-color: var(--base-20);
}

.single .entry-content blockquote p {
	margin-bottom: 0.75rem;
	font-size: 1.1875rem;
	font-style: normal;
	font-weight: 600;
	line-height: 1.6;
	color: var(--contrast-10);
}

.single .entry-content blockquote cite {
	display: block;
	font-size: 0.875rem;
	font-style: normal;
	color: var(--contrast-30);
}

.single .entry-content blockquote cite::before {
	content: "— ";
}

/* ---------- WebberZone Top 10 — popular posts (numbered list) ---------- */
/* WebberZone Top 10 — popular posts. Numbering comes from Top 10's own list HTML
 * (Settings > Output: before_list = <ol>); CSS only boxes the number in white. */
.tptn_posts :is(ol, ul) {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Grid items are not display:list-item, so advance the ordered-list counter explicitly. */
.tptn_posts li {
	counter-increment: list-item;
	display: grid;
	grid-template-columns: 1.25rem minmax(0, 1fr);
	column-gap: 0.625rem;
	align-items: start;
	margin-bottom: 1rem;
}

.tptn_posts li:last-child {
	margin-bottom: 0;
}

.tptn_posts ol > li::before {
	content: counter(list-item);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.125rem;
	border-radius: 3px;
	background-color: var(--base-30);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
	color: var(--contrast-10);
}

.tptn_posts .tptn_link {
	text-decoration: none;
}

.tptn_posts .tptn_title {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.6;
	color: var(--contrast-20);
}

.tptn_posts .tptn_link:hover .tptn_title {
	color: var(--contrast-10);
}

.tptn_posts + br,
.tptn_clear {
	display: none;
}
