/*
Theme Name: Notebook
Theme URI: https://example.com/notebook
Author: Your Name
Author URI: https://example.com
Description: A clean, reading-focused block theme inspired by note-style layouts. Includes a custom Like feature and refined comments. Built for the Full Site Editor.
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: notebook
Tags: blog, one-column, custom-colors, block-styles, full-site-editing, editor-style, threaded-comments, translation-ready
*/

/* -------------------------------------------------------------
   Base tweaks that complement theme.json
   theme.json handles palette, type, spacing. This file covers
   details FSE can't express cleanly (cards, like button, comments).
------------------------------------------------------------- */

:root {
	--nb-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.06);
	--nb-shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.08), 0 12px 28px rgba(0, 0, 0, 0.1);
	--nb-radius-card: 12px;
	--nb-transition: 0.18s ease;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Keep long words from breaking the reading column */
.entry-content,
.wp-block-post-content {
	overflow-wrap: break-word;
	word-break: normal;
}

/* -------------------------------------------------------------
   Site header
------------------------------------------------------------- */
.nb-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid var(--wp--preset--color--border, #e6e6e6);
}

/* -------------------------------------------------------------
   Post cards (query loop)
------------------------------------------------------------- */
.nb-card {
	background: #fff;
	border: 1px solid var(--wp--preset--color--border, #e6e6e6);
	border-radius: var(--nb-radius-card);
	overflow: hidden;
	transition: box-shadow var(--nb-transition), transform var(--nb-transition);
	height: 100%;
}

.nb-card:hover {
	box-shadow: var(--nb-shadow-card-hover);
	transform: translateY(-2px);
}

.nb-card .wp-block-post-featured-image,
.nb-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 9;
	width: 100%;
	object-fit: cover;
	margin: 0;
}

.nb-card .wp-block-post-title {
	font-size: 16px;
	line-height: 1.5;
	font-weight: 700;
	margin: 0;
}

.nb-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent, #2cb696);
}

/* Author line inside cards */
.nb-card .nb-card-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--wp--preset--color--muted, #666);
	font-size: 13px;
}

.nb-card .wp-block-avatar img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}

/* -------------------------------------------------------------
   Like button
------------------------------------------------------------- */
.nb-like {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: 1px solid var(--wp--preset--color--border, #e6e6e6);
	border-radius: 999px;
	background: #fff;
	color: var(--wp--preset--color--muted, #666);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: border-color var(--nb-transition), color var(--nb-transition),
		background var(--nb-transition), transform var(--nb-transition);
	line-height: 1;
	font-family: inherit;
}

.nb-like:hover {
	border-color: var(--wp--preset--color--like, #ff5b5b);
	color: var(--wp--preset--color--like, #ff5b5b);
}

.nb-like:active {
	transform: scale(0.96);
}

.nb-like:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #2cb696);
	outline-offset: 2px;
}

.nb-like .nb-like-icon {
	width: 20px;
	height: 20px;
	display: inline-block;
	transition: transform var(--nb-transition);
}

.nb-like.is-liked {
	border-color: var(--wp--preset--color--like, #ff5b5b);
	color: var(--wp--preset--color--like, #ff5b5b);
	background: rgba(255, 91, 91, 0.06);
}

.nb-like.is-liked .nb-like-icon {
	fill: var(--wp--preset--color--like, #ff5b5b);
	stroke: var(--wp--preset--color--like, #ff5b5b);
}

.nb-like:not(.is-liked) .nb-like-icon {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.nb-like.is-bumped .nb-like-icon {
	animation: nb-heart-pop 0.35s ease;
}

@keyframes nb-heart-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

.nb-like[disabled] {
	cursor: default;
	opacity: 0.9;
}

.nb-like-wrap {
	display: flex;
	justify-content: center;
	margin: 40px 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.nb-card,
	.nb-like,
	.nb-like .nb-like-icon {
		transition: none;
	}
	.nb-like.is-bumped .nb-like-icon {
		animation: none;
	}
}

/* -------------------------------------------------------------
   Comments (note-style: minimal, round avatars, hairline rules)
------------------------------------------------------------- */
.wp-block-comments,
.comments-area {
	max-width: 620px;
	margin-left: auto;
	margin-right: auto;
}

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

.comment-list .comment {
	list-style: none;
	padding: 20px 0;
	border-top: 1px solid var(--wp--preset--color--border, #e6e6e6);
}

.comment-list .comment:first-child {
	border-top: none;
}

.comment-list .children {
	list-style: none;
	margin: 16px 0 0 40px;
	padding: 0;
}

.nb-comment-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.nb-comment-head img.avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

.nb-comment-author {
	font-weight: 700;
	font-size: 15px;
	color: var(--wp--preset--color--contrast, #222);
}

.nb-comment-author a {
	color: inherit;
	text-decoration: none;
}

.nb-comment-date {
	font-size: 13px;
	color: var(--wp--preset--color--faint, #999);
}

.nb-comment-date a {
	color: inherit;
	text-decoration: none;
}

.nb-comment-body {
	font-size: 15px;
	line-height: 1.8;
	color: var(--wp--preset--color--contrast, #222);
	padding-left: 52px;
}

.nb-comment-body p {
	margin: 0 0 0.5em;
}

.comment-reply-link,
.comment-edit-link {
	display: inline-block;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--wp--preset--color--accent, #2cb696);
	text-decoration: none;
}

.comment-reply-link:hover,
.comment-edit-link:hover {
	text-decoration: underline;
}

.comment-awaiting-moderation {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	color: var(--wp--preset--color--faint, #999);
}

/* Comment form */
.comment-respond {
	margin-top: 32px;
}

.comment-respond .comment-reply-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 16px;
}

.comment-form-comment textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 16px;
	border: 1px solid var(--wp--preset--color--border, #e6e6e6);
	border-radius: 10px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.7;
	background: #fff;
	color: var(--wp--preset--color--contrast, #222);
	transition: border-color var(--nb-transition);
}

.comment-form-comment textarea:focus,
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus {
	border-color: var(--wp--preset--color--accent, #2cb696);
	outline: none;
}

.comment-form-comment textarea {
	min-height: 120px;
	resize: vertical;
}

.comment-form label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--wp--preset--color--muted, #666);
	margin-bottom: 6px;
}

.comment-form p {
	margin: 0 0 16px;
}

.comment-form .form-submit .submit {
	background: var(--wp--preset--color--accent, #2cb696);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 32px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background var(--nb-transition);
	font-family: inherit;
}

.comment-form .form-submit .submit:hover {
	background: var(--wp--preset--color--accent-dark, #25997f);
}

.comment-form .form-submit .submit:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-dark, #25997f);
	outline-offset: 2px;
}

/* -------------------------------------------------------------
   Author box
------------------------------------------------------------- */
.nb-author-box {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 24px;
	border: 1px solid var(--wp--preset--color--border, #e6e6e6);
	border-radius: var(--nb-radius-card);
	background: #fff;
}

.nb-author-box .wp-block-avatar img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
}

.nb-author-box .nb-author-name {
	font-weight: 700;
	font-size: 16px;
	margin: 0 0 4px;
}

.nb-author-box .nb-author-bio {
	font-size: 14px;
	line-height: 1.7;
	color: var(--wp--preset--color--muted, #666);
	margin: 0;
}

/* -------------------------------------------------------------
   Accessibility helper
------------------------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #fff;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #222;
	display: block;
	font-size: 14px;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}
