/*
Theme Name: IM News Front
Theme URI: https://imnews.site
Author: I ENVY LLC
Description: Newspaper-style frontend for the IM News WordPress newsroom.
Version: 1.1.0
Text Domain: imnews-front
*/

:root {
  --im-red: #b5121b;
  --im-red-dark: #861018;
  --ink: #111317;
  --muted: #626973;
  --line: #d9dde3;
  --paper: #ffffff;
  --soft: #f4f5f7;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--im-red); }
img { max-width: 100%; height: auto; display: block; }

.im-shell { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }
.im-topbar { background: #0c0d0f; color: #fff; font-size: 13px; }
.im-topbar .im-shell { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.im-breaking { background: var(--im-red); color: #fff; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.im-breaking .im-shell { min-height: 38px; display: flex; align-items: center; gap: 12px; overflow: hidden; }
.im-breaking strong { flex: 0 0 auto; }
.im-breaking span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.im-masthead { border-bottom: 1px solid var(--line); background: #fff; }
.im-masthead-inner { padding: 18px 0 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.im-logo { text-align: center; font-family: Georgia, 'Times New Roman', serif; font-weight: 900; font-size: clamp(34px, 6vw, 68px); letter-spacing: -.055em; line-height: .9; }
.im-logo span { color: var(--im-red); }
.im-edition { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.im-date { text-align: right; font-size: 13px; color: var(--muted); }

.im-nav-wrap { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.im-nav { display: flex; align-items: center; gap: 18px; overflow-x: auto; white-space: nowrap; min-height: 44px; scrollbar-width: none; font-weight: 700; font-size: 14px; }
.im-nav::-webkit-scrollbar { display: none; }
.im-nav a { padding: 12px 0 10px; border-bottom: 3px solid transparent; }
.im-nav a:hover { border-color: var(--im-red); }

.im-front { padding: 24px 0 54px; }
.im-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--line); padding: 9px 0 8px; margin: 28px 0 16px; }
.im-section-head h2 { margin: 0; font: 800 22px/1 Georgia, 'Times New Roman', serif; }
.im-section-head a { color: var(--im-red); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }

.im-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .85fr); gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 26px; }
.im-lead { border-right: 1px solid var(--line); padding-right: 24px; }
.im-kicker { color: var(--im-red); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.im-lead h1 { margin: 9px 0 10px; font: 900 clamp(34px, 5vw, 62px)/.98 Georgia, 'Times New Roman', serif; letter-spacing: -.035em; }
.im-lead .im-dek { margin: 0 0 12px; font-size: 18px; color: #3d434a; max-width: 850px; }
.im-meta { color: var(--muted); font-size: 12px; }
.im-feature-image { margin: 16px 0 14px; aspect-ratio: 16/9; object-fit: cover; width: 100%; background: var(--soft); }
.im-feature-figure { margin: 16px 0 18px; }
.im-feature-figure .im-feature-image { margin: 0; }
.im-image-attribution { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.im-image-attribution a { text-decoration: underline; text-underline-offset: 2px; }
.im-hero-stack { display: grid; gap: 18px; align-content: start; }
.im-side-story { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.im-side-story:last-child { border-bottom: 0; }
.im-side-story h3 { margin: 5px 0 6px; font: 800 22px/1.08 Georgia, 'Times New Roman', serif; }

.im-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.im-card { min-width: 0; }
.im-card-image { aspect-ratio: 16/10; width: 100%; object-fit: cover; background: var(--soft); margin-bottom: 10px; }
.im-card h3 { margin: 5px 0 7px; font: 800 21px/1.08 Georgia, 'Times New Roman', serif; }
.im-card p { margin: 0 0 8px; color: #4b5158; font-size: 14px; }
.im-card .im-meta { margin-top: 8px; }

.im-stream { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; }
.im-list { display: grid; gap: 0; }
.im-list-item { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.im-list-item img { aspect-ratio: 16/10; width: 100%; object-fit: cover; background: var(--soft); }
.im-list-item h3 { margin: 5px 0 7px; font: 800 24px/1.08 Georgia, 'Times New Roman', serif; }

.im-sidebar { border-left: 1px solid var(--line); padding-left: 24px; }
.im-sidebar-box { background: var(--soft); padding: 18px; margin-bottom: 22px; }
.im-sidebar-box h3 { margin: 0 0 12px; font: 800 20px/1 Georgia, 'Times New Roman', serif; border-bottom: 3px solid var(--im-red); padding-bottom: 8px; }
.im-sidebar-box ul { list-style: none; margin: 0; padding: 0; }
.im-sidebar-box li { padding: 9px 0; border-bottom: 1px solid #d7dbe0; font-size: 14px; }
.im-sidebar-box li:last-child { border-bottom: 0; }

.im-edition-bar { background: var(--soft); border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.im-edition-bar strong { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.im-edition-bar select { min-width: 210px; padding: 8px 10px; border: 1px solid #b9bfc7; background: #fff; }

.im-single { padding: 30px 0 60px; }
.im-article { max-width: 860px; margin: 0 auto; }
.im-article h1 { margin: 10px 0 14px; font: 900 clamp(38px, 6vw, 68px)/.98 Georgia, 'Times New Roman', serif; letter-spacing: -.035em; }
.im-article .im-dek { font-size: 20px; color: #444a51; }
.im-article-content { font-family: Georgia, 'Times New Roman', serif; font-size: 19px; line-height: 1.72; }
.im-article-content p { margin: 0 0 1.25em; }
.im-article-content h2, .im-article-content h3 { line-height: 1.1; }
.im-source { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.im-source a { text-decoration: underline; text-underline-offset: 2px; }
.imnews-place-card { margin: 32px 0 8px; padding: 18px 20px; border: 1px solid var(--line); border-left: 5px solid var(--im-red); background: var(--soft); font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.55; }
.imnews-place-card h3 { margin: 0 0 10px; font: 800 22px/1.1 Georgia, 'Times New Roman', serif; }
.imnews-place-card p { margin: 6px 0; }
.imnews-place-card a { color: var(--im-red); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

.im-footer { background: #0c0d0f; color: #d8dbe0; margin-top: 50px; }
.im-footer .im-shell { padding: 34px 0; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.im-footer-logo { color: #fff; font: 900 34px/1 Georgia, 'Times New Roman', serif; }
.im-footer-logo span { color: #e12b34; }
.im-footer h4 { color: #fff; margin: 0 0 10px; }
.im-footer p, .im-footer a { font-size: 13px; color: #c4c8ce; }
.im-copyright { border-top: 1px solid #272a2f; padding: 14px 0 20px; color: #969da5; font-size: 12px; }

.im-empty { background: var(--soft); border: 1px dashed #b8bec6; padding: 28px; text-align: center; color: var(--muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .im-masthead-inner { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .im-date { text-align: center; }
  .im-hero { grid-template-columns: 1fr; }
  .im-lead { border-right: 0; padding-right: 0; }
  .im-hero-stack { grid-template-columns: repeat(2, 1fr); }
  .im-grid { grid-template-columns: repeat(2, 1fr); }
  .im-stream { grid-template-columns: 1fr; }
  .im-sidebar { border-left: 0; padding-left: 0; }
}

@media (max-width: 640px) {
  .im-shell { width: min(calc(100% - 22px), var(--max)); }
  .im-topbar .im-shell { align-items: flex-start; padding: 8px 0; flex-direction: column; gap: 2px; }
  .im-logo { font-size: 44px; }
  .im-hero-stack, .im-grid { grid-template-columns: 1fr; }
  .im-list-item { grid-template-columns: 1fr; }
  .im-footer .im-shell { grid-template-columns: 1fr; }
  .im-lead h1 { font-size: 40px; }
}
