/* =======================================
   rakstiem.css - COMPLETE FILE
   Navigation + Content Cards for all subpages
   Use with skats.css as base
   ======================================= */

/* =======================================
   NAVIGATION - Clean horizontal menu
   Use on all pages except index
   ======================================= */

/* Header strip */
.strip {
  background: transparent;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
  padding: 12px 0;
}

/* Header layout */
.header-flex {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px; /* Space between logo and menu */
}

/* Logo - clickable */
.brand-logo {
  height: 88px; /* Larger logo */
  width: auto;
  display: block;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.12));
}

.logo-link {
  display: block;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo-link:hover {
  opacity: 0.9;
}

/* Navigation container */
.topnav {
  flex: 1; /* Take remaining space */
}

/* Menu list */
.topnav ul {
  display: flex;
  align-items: center;
  gap: 24px; /* Space between menu items */
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

/* Menu links - clean, no decorations */
.topnav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  border-bottom: none;
  padding: 8px 0; /* Vertical padding for better click area */
  transition: color 0.2s ease;
}

.topnav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Current page indicator - ONLY this gets underline */
.topnav .current {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding: 8px 0 6px 0; /* Account for border */
  cursor: default;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

/* Disabled/unclickable menu items */
.topnav .disabled {
  color: var(--muted);
  opacity: 0.5;                    /* Make them look faded */
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 0;
  cursor: default;                 /* No pointer cursor */
  text-decoration: none;
}

/* =======================================
   UTILITY CLASSES
   ======================================= */

/* For hidden page titles when the menu item already indicates the page */
.sr-only {
  position: absolute; 
  width: 1px; 
  height: 1px; 
  padding: 0; 
  margin: -1px;
  overflow: hidden; 
  clip: rect(0,0,0,0); 
  white-space: nowrap; 
  border: 0;
}

/* =======================================
   CONTENT CONTAINER
   ======================================= */

.news-container {
  max-width: 900px;           /* Calm reading width */
  padding-top: 16px;
  margin: 0 auto;
}

/* =======================================
   CONTENT CARDS - Base styles
   ======================================= */

.news-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin: 0 0 24px 0; /* Space between cards */
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.news-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(0,0,0,.10);
  transform: translateY(-1px);
}

/* Whole card is a link */
.news-link,
.news-link:visited {
  display: block;                  /* Mobile-first: stack (image on top) */
  color: inherit;
  text-decoration: none;
}

/* =======================================
   CARD CONTENT ELEMENTS
   ======================================= */

/* Image styling */
.thumb {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(180deg, #f2f2f2, #e9ecef);
}

/* Text area */
.content { 
  padding: 14px 16px; 
}

.title { 
  margin: 0 0 6px; 
  font-size: 1.15rem; 
  font-weight: 800; 
  color: var(--ink); 
}

.meta { 
  margin: 0 0 8px; 
  color: var(--muted); 
  font-weight: 600; 
  font-size: .95rem; 
}

.excerpt { 
  margin: 0 0 10px; 
  color: var(--muted); 
}

.more { 
  color: var(--accent); 
  font-weight: 700; 
}

/* Optional: clamp long excerpts */
.excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =======================================
   LARGE CARDS - Desktop layout
   ======================================= */

@media (min-width: 768px) {
  .news-link {
    display: flex;               /* Image + text side-by-side */
    align-items: stretch;
    gap: 0;
  }
  
  .thumb {
    width: 40%;                  /* Fixed image column */
    flex-shrink: 0;
    aspect-ratio: auto;
    height: auto;
  }
  
  .content {
    flex: 1;
    padding: 20px 24px; /* Generous padding for large cards */
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Alternate: even cards reverse (image right, text left) */
  .news-card:nth-of-type(even) .news-link {
    flex-direction: row-reverse;
  }
}

/* =======================================
   SMALL CARDS
   ======================================= */

.news-card.small {
  margin: 0 0 24px 0; /* Consistent spacing */
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

/* Mobile: stack (same as big card) */
.news-card.small .news-link { 
  display: block; 
}

.news-card.small .thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  height: auto;
  border-radius: 12px 12px 0 0;
}

.news-card.small .content { 
  padding: 16px 20px; /* Better spacing */
}

.news-card.small .title { 
  font-size: 1.05rem; 
  margin: 0 0 .35rem; 
}

.news-card.small .excerpt { 
  font-size: .95rem; 
  margin: 0 0 .5rem; 
}

/* Desktop: small fixed thumb + text, with better spacing */
@media (min-width: 768px) {
  .news-card.small .news-link {
    display: flex !important;
    align-items: center;
    gap: 24px; /* Space between image and text */
    padding: 20px; /* Padding around whole card */
  }
  
  .news-card.small .thumb {
    width: 140px; /* Smaller for better proportion */
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    flex: 0 0 140px;
    border-radius: 12px;
    margin: 0; /* Center the image vertically */
  }
  
  .news-card.small .content { 
    padding: 0; /* Remove padding since parent has it */
    flex: 1;
  }
  
  .news-card.small .title { 
    font-size: 1.1rem; 
    margin: 0 0 8px; /* Space below title */
    line-height: 1.3;
  }
  
  .news-card.small .excerpt { 
    font-size: 0.95rem; 
    margin: 0 0 8px;
    line-height: 1.5;
  }
  
  .news-card.small .more {
    margin-top: 4px;
  }

  /* Alternate small cards - maintain spacing */
  .news-card.small:nth-of-type(even) .news-link {
    flex-direction: row-reverse;
    gap: 24px; /* Consistent spacing for reversed layout */
  }
}

/* =======================================
   TEXT-ONLY CARDS
   ======================================= */

.news-card.text-only .news-link { 
  display: block; 
}

.news-card.text-only .content { 
  padding: 18px 20px; 
}

.news-card.text-only .title { 
  margin-bottom: 4px; 
}

.news-card.text-only .meta { 
  margin-bottom: 10px; 
}

/* =======================================
   FOOTER ADJUSTMENTS
   ======================================= */

.footer {
  margin-top: 24px; /* Extra spacing after content */
}

/* =======================================
   ARTICLE LAYOUT
   Text wrapping around images with flexible positioning
   ======================================= */

.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

/* Article title */
.article-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.2;
}

/* Article meta (date, author) */
.article-meta {
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* Article content */
.article-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink);
}

.article-content a {
    text-decoration: none;
    color: inherit;
}

.article-content p {
  margin: 0 0 18px;
  text-align: justify;
}

.article-content p:last-child {
  margin-bottom: 0;
}

/* =======================================
   EMBEDDED IMAGES - Wrapper system
   ======================================= */

/* Image wrapper approach - BETTER than floating captions */
.img-wrapper {
  display: inline-block;
  border-radius: 12px;
  overflow: hidden;
}

.img-wrapper:hover {
  box-shadow: var(--shadow-lg);
}

.img-wrapper img {
  display: block;
  width: 100%;
  object-fit: cover;
  margin: 0;
}

.img-wrapper .img-caption {
  background: var(--bg);
  padding: 4px 12px;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  background: var(--bg);
  margin: 0;
}

/* =======================================
   POSITIONING CLASSES
   ======================================= */

/* Float left - text wraps on the right */
.img-left {
  float: left;
  margin: 8px 24px 16px 0;
}

/* Float right - text wraps on the left */
.img-right {
  float: right;
  margin: 8px 0 16px 24px;
}

/* Center - full width, no text wrapping */
.img-center {
  display: block;
  margin: 24px auto;
  float: none;
}

/* Size classes - width-based with flexible height */
.img-small {
  width: 200px;
}

.img-small img {
  height: auto;           /* Let height adjust naturally */
  max-height: 200px;      /* But don't get too tall */
}

.img-medium {
  width: 300px;
}

.img-medium img {
  height: auto;
  max-height: 250px;
}

.img-large {
  width: 500px;
}

.img-large img {
  height: auto;
  max-height: 350px;
}

/* =======================================
   CLEARFIX - Stop text wrapping
   ======================================= */

.clear {
  clear: both;
  margin-top: 20px;
}

/* =======================================
  SUBTITLE BAR - lai būtu smukāk
   ======================================= */

.subtitle-full {
    background-color: #1e6a67;
    color: #fbf3e5;
    padding: 10px 16px;
    margin: 28px 0 14px 0;
    font-weight: 600;
    font-size: 1.2rem;
    width: 100%;
    box-sizing: border-box;
}




/* =======================================
   MOBILE RESPONSIVE
   ======================================= */

/* Tablet adjustments */
@media (max-width: 980px) {
  .header-flex {
    gap: 16px;
  }
  
  .topnav ul {
    gap: 20px;
  }
  
  .brand-logo {
    height: 78px;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .brand-logo {
    height: 72px;
    align-self: center; /* Center logo on mobile */
  }
  
  .topnav {
    width: 100%;
  }
  
  .topnav ul {
    justify-content: center; /* Center menu on mobile */
    gap: 16px;
    font-size: 0.95rem;
  }
  
  .topnav a,
  .topnav .current {
    font-size: 0.95rem;
  }
  
  .content { 
    padding: 12px 14px; 
  }
  
  .title { 
    font-size: 1.08rem; 
  }
  
  .news-card.small .content { 
    padding: 16px; /* Consistent mobile padding */
  }
}

/* Very small screens - stack menu vertically */
@media (max-width: 480px) {
  .topnav ul {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .topnav a,
  .topnav .current {
    padding: 6px 0;
  }
}

/* Article mobile responsive */
@media (max-width: 768px) {
  .article-container {
    padding: 16px 0;
  }
  
  .article-content {
    font-size: 1.05rem;
    line-height: 1.6;
  }
  
  /* On mobile, all images become center-aligned */
  .img-left,
  .img-right {
    float: none;
    display: block;
    margin: 16px auto;
    width: 90% !important;
  }
  
  .img-small,
  .img-medium,
  .img-large {
    width: 90% !important;
  }
  
  .img-small img,
  .img-medium img,
  .img-large img {
    height: auto;
  }
}

@media (max-width: 480px) {
  .article-title {
    font-size: 1.6rem;
  }
  
  .article-content {
    font-size: 1rem;
  }
  
  .img-wrapper {
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px) !important;
    border-radius: 8px;
  }
}