/* TWN News - The Guardian Broadsheet Design System */
:root {
  --navy: #052962;
  --navy-dark: #041f4a;
  --yellow: #ffe500;
  --yellow-hover: #e5cd00;
  --red: #c70000;
  --orange: #e05e00;
  --blue-sport: #0084c6;
  --text-primary: #121212;
  --text-secondary: #555555;
  --text-muted: #767676;
  --border-light: #dcdcdc;
  --border-subtle: #eaeaea;
  --bg-light: #f6f6f6;
  --bg-card: #ffffff;
  --font-serif: "Georgia", "Merriweather", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: #ffffff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Container */
.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================================
   HEADER & NAVIGATION
========================================= */
.site-header {
  background-color: var(--navy);
  color: #ffffff;
  border-bottom: 1px solid var(--navy-dark);
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
}

.edition-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #dcdcdc;
  font-weight: 500;
}

.support-btn {
  background: var(--yellow);
  color: #000000;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 20px;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.support-btn:hover {
  background: var(--yellow-hover);
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 16px;
}

.masthead-img-link img {
  height: 62px;
  max-height: 68px;
  width: auto;
  object-fit: contain;
}

.masthead-fallback-text {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1;
}

.masthead-dot {
  color: var(--yellow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.search-toggle-btn:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.menu-round-btn {
  background: var(--yellow);
  color: #000000;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 10px;
  transition: transform 0.15s, background 0.2s;
}

.menu-round-btn:hover {
  background: var(--yellow-hover);
  transform: scale(1.05);
}

.menu-round-btn span {
  display: block;
  width: 20px;
  height: 2.5px;
  background-color: #000000;
  border-radius: 2px;
}

/* Category Navigation Bar */
.nav-categories {
  display: flex;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-categories::-webkit-scrollbar {
  display: none;
}

.nav-link {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 16px;
  position: relative;
  display: inline-block;
  transition: color 0.15s;
}

.nav-link:first-child {
  padding-left: 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--yellow);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--yellow);
}

/* Dateline & Ticker Sub-bar */
.dateline-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 0;
  font-size: 13px;
}

.dateline-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.current-date {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.live-ticker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.live-pill {
  background: var(--red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ffffff;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.ticker-text {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   BROADSHEET HOMEPAGE LAYOUT
========================================= */
.broadsheet-main {
  padding: 24px 0 48px 0;
}

/* Section Header (The Guardian Style) */
.section-headline-bar {
  border-top: 1px solid var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 6px 0;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background-color: var(--red);
}

.section-more-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.section-more-link:hover {
  text-decoration: underline;
}

/* 4-Column Guardian Broadsheet Grid */
.broadsheet-grid {
  display: grid;
  grid-template-columns: 2.2fr 1.3fr 1.1fr;
  gap: 20px;
  align-items: start;
}

/* Lead Big Card (Left Major) */
.lead-card {
  background: #ffffff;
  border-right: 1px solid var(--border-light);
  padding-right: 20px;
}

.lead-image-wrap {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 2px;
}

.lead-image-wrap img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lead-card:hover .lead-image-wrap img {
  transform: scale(1.02);
}

.card-kicker {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kicker-red { color: var(--red); }
.kicker-orange { color: var(--orange); }
.kicker-blue { color: var(--blue-sport); }

.lead-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.lead-title:hover {
  color: var(--navy);
}

.lead-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-meta .time {
  font-weight: 600;
}

/* Mid Column Stories */
.mid-column {
  border-right: 1px solid var(--border-light);
  padding-right: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-card-vertical {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.story-card-vertical:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.story-thumb {
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  border-radius: 2px;
}

.story-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.video-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.story-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.story-title:hover {
  color: var(--navy);
}

.story-summary-short {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Opinion & Side Column */
.side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.opinion-box {
  background: #fef7ee;
  border-top: 3px solid var(--orange);
  padding: 16px;
  border-radius: 2px;
}

.opinion-header {
  font-size: 12px;
  font-weight: 800;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.opinion-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-style: italic;
  line-height: 1.25;
  font-weight: 700;
  color: #121212;
  margin-bottom: 8px;
}

.opinion-author-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.opinion-author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 16px;
}

.opinion-author-meta {
  font-size: 12px;
  line-height: 1.3;
}

.opinion-author-name {
  font-weight: 700;
  color: var(--text-primary);
}

.opinion-author-role {
  color: var(--text-muted);
}

/* Secondary News Row */
.secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--text-primary);
}

.sub-card {
  border-right: 1px solid var(--border-light);
  padding-right: 16px;
}

.sub-card:last-child {
  border-right: none;
  padding-right: 0;
}

.sub-card-img {
  margin-bottom: 10px;
}

.sub-card-img img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 2px;
}

.sub-card-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}

.sub-card-title:hover {
  color: var(--navy);
}

/* =========================================
   ARTICLE DETAIL PAGE
========================================= */
.article-container {
  max-width: 900px;
  margin: 32px auto 60px auto;
  padding: 0 16px;
}

.article-header {
  margin-bottom: 24px;
}

.article-kicker-badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}

.article-headline {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 900;
  line-height: 1.15;
  color: #121212;
  margin-bottom: 16px;
}

.article-standfirst {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.article-byline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
  margin-bottom: 24px;
  font-size: 13px;
}

.article-byline-author {
  font-weight: 700;
  color: var(--navy);
}

.article-main-image {
  margin-bottom: 24px;
}

.article-main-image img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 2px;
}

.image-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 2px;
  border-left: 2px solid var(--border-light);
}

.article-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.7;
  color: #222222;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body blockquote {
  border-left: 4px solid var(--navy);
  padding: 12px 20px;
  margin: 24px 0;
  font-style: italic;
  font-size: 20px;
  color: var(--navy);
  background: var(--bg-light);
}

/* =========================================
   COMMENTS & FORMS
========================================= */
.comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--navy);
}

.comments-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.comment-card {
  background: var(--bg-light);
  border-left: 3px solid var(--navy);
  padding: 16px;
  border-radius: 2px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.comment-author {
  font-weight: 700;
  color: var(--navy);
}

.comment-time {
  color: var(--text-muted);
}

.comment-form {
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 24px;
  border-radius: 4px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(5, 41, 98, 0.1);
}

.btn-primary {
  background: var(--navy);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--navy-dark);
}

/* =========================================
   FOOTER
========================================= */
.site-footer {
  background-color: var(--navy);
  color: #ffffff;
  padding: 48px 0 32px 0;
  margin-top: 60px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 32px;
}

.footer-logo-text {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 900;
}

.footer-back-to-top {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-back-to-top:hover {
  background: rgba(255, 255, 255, 0.2);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

.footer-col-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: var(--yellow);
  margin-bottom: 16px;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer-nav-list a {
  color: #dcdcdc;
  transition: color 0.15s;
}

.footer-nav-list a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  font-size: 12px;
  color: #a0a0a0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-legal-links {
  display: flex;
  gap: 16px;
}

.footer-legal-links a:hover {
  color: #ffffff;
}

/* =========================================
   SEARCH MODAL
========================================= */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 41, 98, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-modal.active {
  display: flex;
}

.search-box-card {
  background: #ffffff;
  width: 100%;
  max-width: 650px;
  padding: 24px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
}

.search-input-field {
  width: 100%;
  font-size: 20px;
  padding: 12px 16px;
  border: 2px solid var(--navy);
  border-radius: 4px;
  outline: none;
  font-family: var(--font-sans);
}

.search-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}

/* =========================================
   RESPONSIVE DESIGN
========================================= */
@media (max-width: 1024px) {
  .broadsheet-grid {
    grid-template-columns: 1fr 1fr;
  }
  .side-column {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .secondary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-top-bar {
    display: none;
  }
  .broadsheet-grid {
    grid-template-columns: 1fr;
  }
  .lead-card {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
  }
  .mid-column {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
  }
  .side-column {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  .secondary-grid {
    grid-template-columns: 1fr;
  }
  .sub-card {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 16px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .lead-title {
    font-size: 24px;
  }
  .lead-image-wrap img {
    height: 220px;
  }
  .article-headline {
    font-size: 28px;
  }
}
