/*
 * Theme Name: Niezwykłe Losy
 * Main Stylesheet
 */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, Cambria, "Times New Roman", Times, serif;
  
  --color-primary: #d97706;
  --color-primary-hover: #b45309;
  --color-primary-light: #fef3c7;
  
  --color-bg: #fafaf9;
  --color-card-bg: #ffffff;
  --color-text-main: #1c1917;
  --color-text-muted: #78716c;
  --color-text-light: #a8a29e;
  --color-border: #e7e5e4;
  --color-border-subtle: #f5f5f4;
  
  --color-dark-bg: #1c1917;
  --color-dark-surface: #292524;
  --color-dark-text: #e7e5e4;
  --color-dark-muted: #a8a29e;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  
  --container-max: 1152px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--color-text-main);
  line-height: 1.25;
  font-weight: 700;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1 0 auto;
  padding-top: 2rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 768px) {
  .site-main {
    padding-top: 2.5rem;
    padding-bottom: 4.5rem;
  }
}

/* Header & Navigation */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-branding {
  display: flex;
  align-items: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-main);
}

.brand-link:hover {
  color: var(--color-primary);
}

.brand-icon {
  width: 1.65rem;
  height: 1.65rem;
  color: var(--color-primary);
}

/* Nav Menu */
.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    align-items: center;
  }
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-menu li a {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
  position: relative;
  padding: 0.25rem 0;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a {
  color: var(--color-primary);
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.mobile-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 768px) {
  .mobile-toggle {
    display: none;
  }
}

/* Mobile Drawer */
.mobile-nav-drawer {
  display: none;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.25rem 1.5rem;
}

.mobile-nav-drawer.is-open {
  display: block;
}

.mobile-nav-drawer .nav-menu {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.mobile-nav-drawer .nav-menu li a {
  font-size: 1rem;
  display: block;
  width: 100%;
}

/* Featured Story / Hero */
.featured-story-section {
  margin-bottom: 3.5rem;
}

.featured-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.featured-card:hover {
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .featured-card {
    flex-direction: row;
    align-items: stretch;
  }
}

.featured-image-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  background: #e7e5e4;
}

@media (min-width: 768px) {
  .featured-image-wrap {
    width: 58%;
  }
}

.featured-image-wrap img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .featured-image-wrap img {
    height: 100%;
    min-height: 420px;
  }
}

.featured-card:hover .featured-image-wrap img {
  transform: scale(1.03);
}

.featured-content-wrap {
  width: 100%;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .featured-content-wrap {
    width: 42%;
    padding: 2.5rem 2.5rem;
  }
}

.badge-featured {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.featured-title {
  font-size: 1.85rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .featured-title {
    font-size: 2.25rem;
  }
}

.featured-card:hover .featured-title a {
  color: var(--color-primary-hover);
}

.featured-excerpt {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.story-meta .meta-author {
  font-weight: 600;
  color: var(--color-text-main);
}

.story-meta .meta-sep {
  opacity: 0.6;
}

/* Stories Grid */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.section-title {
  font-size: 1.65rem;
  color: var(--color-text-main);
}

.stories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Story Card */
.story-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

.story-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.story-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f5f5f4;
}

.story-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.story-card:hover .story-card-thumb img {
  transform: scale(1.05);
}

.story-card-body {
  padding: 1.35rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.story-card-title {
  font-size: 1.25rem;
  line-height: 1.35;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.story-card:hover .story-card-title a {
  color: var(--color-primary-hover);
}

.story-card-excerpt {
  color: var(--color-text-muted);
  font-size: 0.925rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.story-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: 0.875rem;
  border-top: 1px solid var(--color-border-subtle);
}

.story-card-footer .author-name {
  font-weight: 600;
  color: var(--color-text-main);
}

/* Single Story View */
.single-story-article {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.925rem;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  text-decoration: underline;
}

.story-header {
  margin-bottom: 2rem;
}

.story-page-title {
  font-size: 2.25rem;
  line-height: 1.2;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .story-page-title {
    font-size: 2.85rem;
  }
}

.single-hero-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

/* Typography / Article Prose */
.prose-content {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  line-height: 1.8;
  color: #1f2937;
}

.prose-content p {
  margin-bottom: 1.6rem;
}

.prose-content .lead-excerpt {
  font-size: 1.35rem;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 2rem;
  font-style: italic;
}

.prose-content h2 {
  font-size: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #111827;
}

.prose-content h3 {
  font-size: 1.65rem;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  color: #111827;
}

.prose-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1.25rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin: 1.75rem 0;
}

.prose-content ul, 
.prose-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.prose-content li {
  margin-bottom: 0.5rem;
}

.prose-content strong {
  color: var(--color-text-main);
}

/* Standard Page Layout */
.page-container {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.page-title {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .page-title {
    font-size: 2.75rem;
  }
}

/* Contact Form */
.contact-form-wrap {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #44403c;
  margin-bottom: 0.35rem;
  font-family: var(--font-sans);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  border: 1px solid #d6d3d1;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--color-text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.btn-primary {
  display: inline-block;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: var(--font-sans);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
}

.alert-message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.925rem;
}

.alert-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Pagination */
.pagination-wrapper {
  margin-top: 3.5rem;
  display: flex;
  justify-content: center;
}

.pagination-wrapper .nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text-main);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.pagination-wrapper .page-numbers:hover,
.pagination-wrapper .page-numbers.current {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

/* Footer */
.site-footer {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-muted);
  padding-top: 3rem;
  padding-bottom: 2.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-brand .brand-link {
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.footer-tagline {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .footer-links-col {
    align-items: flex-end;
  }
}

.footer-heading {
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

@media (min-width: 768px) {
  .footer-menu {
    text-align: right;
  }
}

.footer-menu li a {
  color: var(--color-dark-muted);
  font-size: 0.9rem;
}

.footer-menu li a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #292524;
  padding-top: 1.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: #78716c;
}
