/**
 * Homepage Styles - Newspaper Layout
 * Myśl Konserwatywna - Portal Publicystyczny
 * 
 * Classic newspaper-style layout with sidebar
 */

/* ===========================================
   HERO NEWSPAPER LAYOUT
   =========================================== */

.hero-newspaper {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4); /* Reduced from space-6 */
  margin-top: var(--space-4); /* Reduced from space-6 */
}

@media (min-width: 1024px) {
  .hero-newspaper {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-6); /* Reduced from space-8 */
  }
}

/* Main Hero Article */
.hero-main {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-main-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.hero-main-image {
  position: relative;
  margin: 0;
}

.hero-main-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 24/9; /* Further reduced to align with secondary items */
  object-fit: cover;
}

.hero-main-content {
  padding: var(--space-4); /* Reduced from space-6 */
}

.hero-main-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-bottom: var(--space-2); /* Reduced from space-3 */
  transition: color 0.2s ease;
}

@media (min-width: 768px) {
  .hero-main-title {
    font-size: var(--text-3xl);
  }
}

.hero-main-link:hover .hero-main-title {
  color: var(--color-secondary);
}

.hero-main-excerpt {
  font-size: var(--text-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-light);
  margin-bottom: var(--space-3); /* Reduced from space-4 */
}

@media (min-width: 768px) {
  .hero-main-excerpt {
    font-size: var(--text-lg);
  }
}

.hero-main-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.hero-author {
  font-weight: var(--font-weight-medium);
}

/* Secondary Hero Items */
.hero-secondary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%; /* Match parent height */
}

.hero-secondary-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
  flex: 1; /* Equal height distribution */
}

.hero-secondary-item:hover {
  box-shadow: var(--shadow-md);
}

.hero-secondary-item a {
  display: flex;
  gap: var(--space-4);
  text-decoration: none;
  color: inherit;
  height: 100%; /* Full height for alignment */
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-secondary-item a {
    flex-direction: row;
  }
}

.hero-secondary-image {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  margin: 0;
}

@media (min-width: 1024px) {
  .hero-secondary-image {
    width: 140px;
  }
}

.hero-secondary-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.hero-secondary-content {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.hero-secondary-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  
  /* Limit to 3 lines for better readability */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-secondary-item:hover .hero-secondary-title {
  color: var(--color-secondary);
}

.hero-secondary-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ===========================================
   HOMEPAGE LAYOUT (Main + Sidebar)
   =========================================== */

.homepage-layout {
  padding: var(--space-10) 0;
  background: var(--color-bg);
}

.homepage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .homepage-grid {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-10);
  }
}

/* Main Content Area */
.homepage-main {
  min-width: 0; /* Prevent overflow */
}

.homepage-section {
  margin-bottom: var(--space-10);
}

.homepage-section:last-child {
  margin-bottom: 0;
}

/* Section Header - Bordered Style */
.section-header--bordered {
  border-bottom: 3px solid var(--color-primary);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-6);
}

.section-header--bordered .section-title {
  font-size: var(--text-xl);
  margin: 0;
}

@media (min-width: 768px) {
  .section-header--bordered .section-title {
    font-size: var(--text-2xl);
  }
}

/* ===========================================
   ARTICLES NEWSPAPER LAYOUT
   =========================================== */

.articles-newspaper {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .articles-newspaper {
    grid-template-columns: 1fr 1fr;
  }
}

/* Featured Article */
.article-featured {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .article-featured {
    grid-row: span 2;
  }
}

.article-featured-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.article-featured-image {
  margin: 0;
}

.article-featured-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.article-featured-content {
  padding: var(--space-5);
}

.category-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.article-featured-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.article-featured-link:hover .article-featured-title {
  color: var(--color-secondary);
}

.article-featured-excerpt {
  font-size: var(--text-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-light);
  margin-bottom: var(--space-3);
}

.article-featured-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.article-featured-meta .author {
  font-weight: var(--font-weight-medium);
}

.article-featured-meta .author::after {
  content: ' · ';
}

/* Articles List */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.article-list-item {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.article-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.article-list-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.article-list-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-bottom: var(--space-1);
  transition: color 0.2s ease;
}

.article-list-item a:hover .article-list-title {
  color: var(--color-secondary);
}

.article-list-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-list-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ===========================================
   NEWS GRID / ANNOUNCEMENTS GRID
   =========================================== */

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
}

.news-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.news-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.05);
}

.news-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  padding: var(--space-3);
  padding-bottom: var(--space-2);
  
  /* Limit to 2 lines for compact display */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-date {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: 0 var(--space-3) var(--space-3);
}

/* Announcement badge on image */
.news-card-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  color: white;
  background: var(--color-accent);
}

/* Badge variants for different announcement types */
.news-card-badge--news {
  background: #0891b2; /* Cyan for news */
}

.news-card-badge--announcement {
  background: #7c3aed; /* Purple for announcements */
}

.news-card-badge--request {
  background: #dc2626; /* Red for requests */
}

.news-card-badge--statement {
  background: #059669; /* Green for statements */
}

/* ===========================================
   VIDEOS ROW
   =========================================== */

.videos-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .videos-row {
    flex-direction: row;
  }
}

/* ===========================================
   VIDEOS GRID (6 items)
   =========================================== */

.videos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .videos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .videos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.video-card-horizontal {
  flex: 1;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.video-card-horizontal:hover {
  box-shadow: var(--shadow-md);
}

/* In grid layout, stack vertically */
.videos-grid .video-card-horizontal a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.videos-grid .video-card-thumb {
  width: 100%;
}

.videos-grid .video-card-thumb img {
  aspect-ratio: 16/9;
}

/* In row layout, horizontal */
.videos-row .video-card-horizontal a {
  display: flex;
  flex-direction: row;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.video-card-thumb {
  position: relative;
  flex-shrink: 0;
  width: 140px;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/10;
}

/* Full width thumb in grid */
.videos-grid .video-card-thumb {
  width: 100%;
}

.videos-grid .video-card-thumb img {
  aspect-ratio: 16/9;
}

.video-card-thumb .video-duration {
  position: absolute;
  bottom: var(--space-1);
  right: var(--space-1);
  padding: 2px 6px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: white;
  background: rgba(0,0,0,0.8);
  border-radius: var(--radius-sm);
}

.video-card-info {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.video-card-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}


/* ===========================================
   SIDEBAR
   =========================================== */

.homepage-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Sidebar Widget Base */
.sidebar-widget {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.sidebar-widget-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-accent);
}

.sidebar-widget p {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
}

.sidebar-link {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  text-decoration: none;
  margin-top: var(--space-3);
}

.sidebar-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Support Widget */
.sidebar-widget--support {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark, #0f2442) 100%);
  color: var(--color-text-inverse);
}

.sidebar-widget--support .sidebar-widget-title {
  color: var(--color-text-inverse);
  border-bottom-color: var(--color-accent);
}

.sidebar-widget--support p {
  color: rgba(255, 255, 255, 0.9);
}

.sidebar-widget--support .btn {
  width: 100%;
  text-align: center;
}

/* Authors Widget */
.authors-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.author-mini {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
  padding: var(--space-2);
  margin: calc(var(--space-2) * -1);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.author-mini:hover {
  background: var(--color-bg-alt);
}

.author-mini-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-mini-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-mini-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.author-mini-role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Events Widget */
.events-mini-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.event-mini {
  display: flex;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
  padding: var(--space-2);
  margin: calc(var(--space-2) * -1);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.event-mini:hover {
  background: var(--color-bg-alt);
}

.event-mini-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--color-secondary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.event-mini-day {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.event-mini-month {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-mini-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.event-mini-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  line-height: var(--line-height-tight);
}

.event-mini-location {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Newsletter Widget */
.newsletter-form-vertical {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.newsletter-form-vertical .form-input {
  width: 100%;
  padding: var(--space-3);
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.newsletter-form-vertical .form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.btn-block {
  width: 100%;
}

/* Comments Widget */
.sidebar-widget--comments {
  background: var(--color-surface);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.comment-mini {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.comment-mini:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.comment-mini-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.comment-mini-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
}

.comment-mini-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.comment-mini-author {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

.comment-mini-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.comment-mini-text {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.5;
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.comment-mini-link {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.comment-mini-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Social Widget */
.social-links-vertical {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.social-link-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
}

.social-link-item:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.social-link-item svg {
  flex-shrink: 0;
}

/* ===========================================
   PARTNERS SECTION
   =========================================== */

.partners-section {
  padding: var(--space-10) 0;
  background: var(--color-bg-alt);
}

.partners-section--top {
  padding: var(--space-6) 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}

.partners-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-6);
}

/* ===========================================
   SECTION HEADER WITH LINK
   =========================================== */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.section-link {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  text-decoration: none;
}

.section-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ===========================================
   CONTENT TYPE BADGES (Hero)
   =========================================== */

.content-type {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  color: white;
}

.content-type--article {
  background: var(--color-primary);
}

.content-type--video,
.content-type--nagranie {
  background: var(--color-secondary);
}

.content-type--news {
  background: var(--color-accent);
}

.content-type--event {
  background: #059669;
}

/* ===========================================
   BUTTONS (ensure they work in sidebar)
   =========================================== */

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-dark, #0f2442);
}

.btn-secondary {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.btn-secondary:hover {
  background: #9a7209;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS
   =========================================== */

@media (max-width: 1023px) {
  .homepage-sidebar {
    order: 2;
  }
  
  .homepage-main {
    order: 1;
  }
}

/* Hide sidebar on very small screens, show as collapsed sections */
@media (max-width: 767px) {
  .sidebar-widget {
    padding: var(--space-4);
  }
  
  .author-mini-avatar {
    width: 40px;
    height: 40px;
  }
  
  .event-mini-date {
    width: 44px;
    height: 44px;
  }
}


/* ===========================================
   CATEGORIES WIDGET
   =========================================== */

.categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.category-link {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
}

.category-link:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ===========================================
   VIDEO CATEGORY LABEL
   =========================================== */

.video-category {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}
