/*
Theme Name: LilCraftStories.
Theme URI: https://example.com/litcraftstories
Author: voohoofficial
Author URI: https://vooho.in
Description: A modern editorial theme tailored for long-form journalism, featuring a beautiful "Architecture of Silence" aesthetic with built-in reading progress and tactile interactions.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: litcraftstories
*/

/* Google Fonts are loaded via wp_enqueue_style() in functions.php, not
   @import here — @import forces a serial fetch waterfall (discovered only
   after this stylesheet loads) instead of a parallel request, which is a
   well-documented Core Web Vitals / LCP penalty. */

:root {
  /* Colors */
  --surface: #f7fafc;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f1f4f6;
  --surface-container: #ebeef0;
  --on-surface: #181c1e;
  --on-surface-variant: #45474c;
  --outline: #76777c;
  --outline-variant: #c6c6cc;
  --primary: #030813;
  --on-primary: #ffffff;
  --primary-container: #1a202c;
  --on-primary-container: #828796;
  --secondary: #775a19;
  --on-secondary: #ffffff;
  --secondary-container: #fed488;
  --on-secondary-container: #785a1a;
  --tertiary-container: #152031;
  --on-primary-fixed-variant: #414754;
  --secondary-fixed: #ffdea5;
  --secondary-fixed-dim: #e9c176;

  /* Typography */
  --font-serif: 'Libre Caslon Text', serif;
  --font-sans: 'Inter', sans-serif;

  /* Spacing */
  --container-max: 1280px;
  --article-max: 720px;
  --gutter: 24px;
  --margin-mobile: 16px;
  --stack-sm: 8px;
  --stack-md: 16px;
  --stack-lg: 32px;
  --stack-xl: 64px;

  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius-default: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Typography Classes */
.display-xl {
  font-family: var(--font-serif);
  font-size: 60px;
  line-height: 72px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.headline-lg {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 56px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.headline-md {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
}

.headline-sm {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}

.body-lg {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 32px;
  font-weight: 400;
}

.body-md {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.label-caps {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.caption {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

.tracking-widest { letter-spacing: 0.1em; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Colors */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-white { color: #fff; }
.text-white-80 { color: rgba(255, 255, 255, 0.8); }
.text-on-surface-variant { color: var(--on-surface-variant); }
.text-outline { color: var(--outline); }
.text-on-primary { color: var(--on-primary); }
.text-on-primary-fixed-variant { color: var(--on-primary-fixed-variant); }
.hover-secondary:hover { color: var(--secondary); }
.bg-secondary { background-color: var(--secondary); }

/* Layout Utilities */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (max-width: 767px) {
  .container {
    padding: 0 var(--margin-mobile);
  }
  .display-xl {
    font-size: 32px;
    line-height: 40px;
  }
  .hidden-mobile {
    display: none !important;
  }
}

.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.gap-sm { gap: var(--stack-sm); }
.gap-md { gap: var(--stack-md); }
.gap-lg { gap: var(--stack-lg); }
.gap-xl { gap: var(--stack-xl); }
.gap-gutter { gap: var(--gutter); }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.object-cover { object-fit: cover; }
.overflow-hidden { overflow: hidden; }

/* Margins & Padding */
.mb-sm { margin-bottom: var(--stack-sm); }
.mb-md { margin-bottom: var(--stack-md); }
.mb-lg { margin-bottom: var(--stack-lg); }
.mb-xl { margin-bottom: var(--stack-xl); }
.mt-xl { margin-top: var(--stack-xl); }
.py-md { padding-top: var(--stack-md); padding-bottom: var(--stack-md); }
.py-lg { padding-top: var(--stack-lg); padding-bottom: var(--stack-lg); }
.py-xl { padding-top: var(--stack-xl); padding-bottom: var(--stack-xl); }
.pb-sm { padding-bottom: var(--stack-sm); }
.pl-sm { padding-left: var(--stack-sm); }

/* UI Components */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}

.icon-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--secondary); }
.icon-btn:active { transform: scale(0.95); }

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background-color: var(--secondary);
  z-index: 100;
  width: 0%;
  transition: width 0.1s ease-out;
}

.site-header {
  background: rgba(247, 250, 252, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(3, 8, 19, 0.1);
  height: 64px;
  z-index: 50;
  transition: box-shadow 0.3s ease;
}

.site-header.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.main-content {
  padding-top: 64px;
  min-height: 100vh;
}

.tactile-button-primary {
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-bottom: 2px solid var(--secondary);
  padding: 12px 32px;
  border-radius: var(--radius-default);
  cursor: pointer;
  transition: all 0.1s ease;
  font-family: var(--font-sans);
}

.tactile-button-primary:active {
  border-bottom-width: 1px;
  transform: translateY(1px);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--outline-variant);
  padding: 12px 32px;
  border-radius: var(--radius-default);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-sans);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--on-primary);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: all 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.image-zoom-container {
  overflow: hidden;
}

.image-zoom-container img {
  transition: transform 0.7s ease;
}

.image-zoom-container:hover img {
  transform: scale(1.05);
}

/* Specific Sections */
.hero-section {
  position: relative;
  width: 100%;
  height: 707px;
  overflow: hidden;
}
@media (max-width: 767px) {
  .hero-section { height: 618px; }
}
.hero-image-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-gradient {
  background: linear-gradient(to top, rgba(3, 8, 19, 0.8) 0%, rgba(3, 8, 19, 0.2) 50%, transparent 100%);
}
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding-bottom: var(--stack-xl);
}
@media (max-width: 767px) {
  .hero-content { padding-bottom: var(--margin-mobile); }
}
.hero-text-max {
  max-width: var(--article-max);
}

.featured-badge {
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  padding: 4px 12px;
  border-radius: var(--radius-lg);
  display: inline-block;
}

.dot-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

/* Grid Layouts for the two main pages */
.grid-main {
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .grid-main {
    grid-template-columns: repeat(12, 1fr);
  }
  .col-8 {
    grid-column: span 8;
  }
  .col-4 {
    grid-column: span 4;
  }
  .md-flex-row {
    flex-direction: row;
  }
}

.section-title {
  border-bottom: 1px solid rgba(3, 8, 19, 0.05);
  padding-bottom: 16px;
}
.section-title-border {
  border-left: 4px solid var(--secondary);
  padding-left: 12px;
}
.border-subtle {
  border: 1px solid rgba(3, 8, 19, 0.05);
}

.card {
  background-color: var(--surface-container-lowest);
  transition: all 0.3s ease;
  cursor: pointer;
}
.card:hover h4 {
  color: var(--secondary);
}

.feed-card {
  overflow: hidden;
}
.feed-image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
}
@media (min-width: 768px) {
  .feed-image-wrapper {
    width: 33.333%;
  }
}

.feed-content {
  flex: 1;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.grayscale {
  filter: grayscale(100%);
}
.transition-colors {
  transition: color 0.3s ease;
}

.sticky-sidebar {
  position: sticky;
  top: 96px; /* 64px header + 32px spacing */
}

.sidebar-widget {
  background-color: var(--surface-container-low);
  padding: var(--stack-md);
  border-radius: var(--radius-default);
}

.input-field {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(118, 119, 124, 0.2); /* outline/20 */
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-family: var(--font-sans);
  color: var(--on-surface);
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--secondary);
}

.topic-tag {
  background-color: #fff;
  border: 1px solid rgba(118, 119, 124, 0.2);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.topic-tag:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.footer-gradient {
  background-color: var(--primary);
  color: var(--on-primary);
  border-top: 4px solid var(--secondary);
}
.footer-copy {
  opacity: 0.6;
}
.footer-credit {
  opacity: 0.5;
  margin-top: var(--stack-sm);
}
.footer-credit a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Utility classes needed by the WP templates, missing from the original static build */
.mt-sm { margin-top: var(--stack-sm); }
.mt-md { margin-top: var(--stack-md); }
.mt-lg { margin-top: var(--stack-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.tracking-tight { letter-spacing: -0.01em; }
.max-w-article-max { max-width: var(--article-max); }

/* WP Post Content Styling */
.post-content {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 30px;
  color: var(--on-surface);
}
.post-content h2, .post-content h3 {
  font-family: var(--font-serif);
  margin-top: var(--stack-lg);
  margin-bottom: var(--stack-sm);
  color: var(--primary);
}
.post-content p {
  margin-bottom: var(--stack-md);
}
.post-content ul,
.post-content ol {
  padding-left: var(--stack-lg);
  margin-bottom: var(--stack-md);
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: var(--stack-sm); }
.post-content img {
  border-radius: var(--radius-default);
  margin: var(--stack-md) 0;
}
.post-content a {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Pullquotes: per the LitCraft publishing guidelines, any Quote block the
   editor adds in the WordPress editor should automatically pick up our
   signature gold accent lines, no manual styling required. */
.post-content blockquote {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  color: var(--primary);
  max-width: var(--article-max);
  margin: var(--stack-xl) auto;
  padding: var(--stack-lg) var(--gutter);
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(3, 8, 19, 0.05);
}
.post-content blockquote::before,
.post-content blockquote::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background-color: var(--secondary);
  margin: 0 auto var(--stack-lg);
}
.post-content blockquote::after {
  margin: var(--stack-lg) auto 0;
}
.post-content blockquote cite {
  display: block;
  margin-top: var(--stack-md);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.post-pagination {
  margin-top: var(--stack-lg);
  color: var(--on-surface-variant);
}
.post-pagination a {
  color: var(--secondary);
}

/* Post navigation (previous/next) */
.post-nav {
  border-top: 1px solid rgba(3, 8, 19, 0.08);
  padding-top: var(--stack-lg);
}
.post-nav a {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--primary);
  transition: color 0.2s ease;
}
.post-nav a:hover {
  color: var(--secondary);
}

/* Comments */
.comments-area {
  border-top: 1px solid rgba(3, 8, 19, 0.08);
  padding-top: var(--stack-xl);
}
.comment-list {
  margin-bottom: var(--stack-xl);
}
.comment-list .children {
  list-style: none;
  padding-left: var(--stack-xl);
  margin-top: var(--stack-lg);
}
.comment-body {
  background-color: var(--surface-container-low);
  border-radius: var(--radius-default);
  padding: var(--stack-md);
}
.comment-author .avatar {
  border-radius: 50%;
  vertical-align: middle;
  margin-right: var(--stack-sm);
}
.comment-author .fn {
  font-weight: 600;
  font-style: normal;
}
.comment-metadata {
  font-size: 12px;
  color: var(--outline);
  margin-bottom: var(--stack-sm);
}
.comment-metadata a { color: inherit; }
.comment-content p { margin-bottom: var(--stack-sm); }
.reply a {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
}
.comment-form p { margin-bottom: var(--stack-md); }
.comment-form label {
  display: block;
  margin-bottom: var(--stack-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(118, 119, 124, 0.2);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-family: var(--font-sans);
}

/* Mobile nav (off-canvas dropdown revealed by the header's menu button) */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  background: var(--surface-container-lowest);
  border-bottom: 1px solid rgba(3, 8, 19, 0.1);
  z-index: 49;
  padding: var(--stack-md) 0;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a { padding: var(--stack-sm) 0; }

@media (min-width: 768px) {
  .mobile-nav { display: none !important; }
}

/* Contact Form 7 output, styled to match the theme */
.wpcf7-form label {
  display: block;
  margin-bottom: var(--stack-md);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.wpcf7-form .wpcf7-form-control {
  display: block;
  width: 100%;
  margin-top: var(--stack-sm);
  background: #fff;
  border: 1px solid rgba(118, 119, 124, 0.2);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--on-surface);
}
.wpcf7-form textarea.wpcf7-form-control {
  min-height: 140px;
  resize: vertical;
}
.wpcf7-form .wpcf7-form-control:focus {
  outline: none;
  border-color: var(--secondary);
}
.wpcf7-form input[type="submit"] {
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-bottom: 2px solid var(--secondary);
  padding: 12px 32px;
  border-radius: var(--radius-default);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wpcf7-form input[type="submit"]:active {
  border-bottom-width: 1px;
  transform: translateY(1px);
}
.wpcf7-form .wpcf7-not-valid-tip {
  color: #b3261e;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  margin-top: var(--stack-sm);
}
.wpcf7-form .wpcf7-response-output {
  margin-top: var(--stack-md);
  padding: 12px 16px;
  border-radius: var(--radius-default);
  font-size: 14px;
}
.wpcf7-form.sent .wpcf7-response-output {
  border-color: var(--secondary);
  color: var(--secondary);
}
.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output {
  border-color: #b3261e;
  color: #b3261e;
}

.litcraft-breadcrumbs a {
  color: var(--secondary);
}
.litcraft-breadcrumbs a:hover {
  text-decoration: underline;
}

/* Standard WordPress screen-reader-only text (used inside the default
   search form and comment form labels) */
.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 !important;
  width: 1px;
  word-wrap: normal !important;
}

/* WordPress's default get_search_form() markup, styled to match the theme
   wherever it's used: the header dropdown, search.php, and 404.php. */
.search-form {
  display: flex;
  gap: var(--stack-sm);
}
.search-form label { flex: 1; }
.search-field {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(118, 119, 124, 0.2);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-family: var(--font-sans);
  color: var(--on-surface);
}
.search-field:focus {
  outline: none;
  border-color: var(--secondary);
}
.search-submit {
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-default);
  padding: 0 24px;
  cursor: pointer;
  font-family: var(--font-sans);
}

/* Header search panel (positioning only; form styling is shared above) */
.header-search-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--surface-container-lowest);
  border-bottom: 1px solid rgba(3, 8, 19, 0.1);
  padding: var(--stack-md) 0;
}
.header-search-panel.is-open { display: block; }
