/*
Theme Name: FableNews
Theme URI: https://example.com/fablenews
Author: Muzammil Raza
Author URI: https://example.com
Description: A lightweight minimalist WordPress news and magazine theme with rounded cards, soft shadows, a widget-ready homepage, category sections, breaking news, and a premium editorial layout.
Version: 1.2.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: fablenews
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: news, blog, magazine, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, right-sidebar, block-styles, wide-blocks
*/

:root {
  --fn-bg: #f5f6f8;
  --fn-surface: #ffffff;
  --fn-surface-soft: #f9fafb;
  --fn-text: #16181d;
  --fn-muted: #6b7280;
  --fn-border: #e5e7eb;
  --fn-accent: #0f766e;
  --fn-accent-strong: #115e59;
  --fn-danger: #dc2626;
  --fn-radius-sm: 10px;
  --fn-radius-md: 16px;
  --fn-radius-lg: 24px;
  --fn-radius-xl: 30px;
  --fn-shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.05);
  --fn-shadow-md: 0 14px 38px rgba(15, 23, 42, 0.08);
  --fn-shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --fn-container: 1240px;
  --fn-reading: 780px;
  --fn-global-font: Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--fn-bg);
  color: var(--fn-text);
  font-family: var(--fn-global-font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover,
a:focus-visible {
  color: var(--fn-accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
input[type="submit"],
.wp-element-button,
.wp-block-button__link {
  border: 0;
  border-radius: 999px;
  background: var(--fn-text);
  color: #fff;
  padding: 0.78rem 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
input[type="submit"]:hover,
.wp-element-button:hover,
.wp-block-button__link:hover {
  background: var(--fn-accent);
  color: #fff;
  transform: translateY(-1px);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--fn-border);
  border-radius: 12px;
  background: #fff;
  color: var(--fn-text);
  padding: 0.82rem 0.95rem;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--fn-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fn-accent) 15%, transparent);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  margin: 0;
  clip: auto;
  background: #fff;
  color: #000;
  z-index: 99999;
}

.site-shell,
.fn-container {
  width: min(calc(100% - 32px), var(--fn-container));
  margin-inline: auto;
}

.fn-card {
  background: var(--fn-surface);
  border: 1px solid var(--fn-border);
  border-radius: var(--fn-radius-md);
  box-shadow: var(--fn-shadow-sm);
}

.fn-section {
  margin-top: 30px;
}

.fn-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.fn-section-title {
  margin: 0;
  font-family: var(--fn-global-font);
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.fn-section-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--fn-accent);
}

.fn-view-all {
  color: var(--fn-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.fn-view-all:hover {
  color: var(--fn-accent);
}

/* Top bar */
.fn-topbar {
  background: #111318;
  color: #d1d5db;
  font-size: 0.83rem;
}

.fn-topbar-inner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.fn-topbar-links,
.fn-social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.fn-topbar a:hover {
  color: #fff;
}

/* Header */
.site-header {
  padding: 18px 0 10px;
}

.fn-header-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr);
  align-items: center;
  gap: 26px;
  padding: 18px 22px;
}

.site-branding {
  min-width: 0;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  max-height: 58px;
  width: auto;
}

.site-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.04em;
}

.site-title a:hover {
  color: inherit;
}

.site-description {
  margin: 7px 0 0;
  color: var(--fn-muted);
  font-size: 0.88rem;
}

.fn-header-ad {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: var(--fn-muted);
  background: var(--fn-surface-soft);
  border: 1px dashed #cfd4dc;
  border-radius: var(--fn-radius-md);
}

.fn-header-ad img {
  display: block;
  max-height: 90px;
  object-fit: contain;
}

/* Navigation */
.fn-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-top: 10px;
}

.admin-bar .fn-nav-wrap {
  top: 32px;
}

.fn-navigation {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 0 12px 0 18px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.primary-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu li {
  position: relative;
}

.primary-menu > li > a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.primary-menu > li.current-menu-item > a,
.primary-menu > li > a:hover {
  background: var(--fn-surface-soft);
  color: var(--fn-accent);
}

.primary-menu .sub-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--fn-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--fn-shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: 0.2s ease;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.primary-menu .sub-menu a {
  display: block;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.9rem;
}

.primary-menu .sub-menu a:hover {
  background: var(--fn-surface-soft);
}

.fn-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fn-search-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 12px;
  background: var(--fn-surface-soft);
  color: var(--fn-text);
}

.fn-search-toggle:hover {
  color: #fff;
}

.fn-search-panel {
  display: none;
  padding: 14px;
  margin-top: 8px;
}

.fn-search-panel.is-open {
  display: block;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-form label {
  flex: 1;
}

.search-form .search-submit {
  flex: 0 0 auto;
}

/* Breaking ticker */
.fn-breaking {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  overflow: hidden;
  min-height: 52px;
  margin-top: 14px;
}

.fn-breaking-label {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: var(--fn-danger);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fn-breaking-track {
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  overflow: hidden;
}

.fn-breaking-item {
  display: none;
  width: 100%;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fn-breaking-item.is-active {
  display: block;
}

/* Hero */
.fn-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.fn-hero-secondary {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.fn-story-overlay {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: var(--fn-radius-lg);
  box-shadow: var(--fn-shadow-md);
  background: #222;
}

.fn-story-overlay.fn-story-main {
  min-height: 522px;
}

.fn-story-overlay > a,
.fn-story-overlay img {
  width: 100%;
  height: 100%;
}

.fn-story-overlay > a {
  position: absolute;
  inset: 0;
}

.fn-story-overlay img {
  display: block;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.fn-story-overlay:hover img {
  transform: scale(1.025);
}

.fn-story-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.03) 28%, rgba(0,0,0,0.83) 100%);
}

.fn-story-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: clamp(18px, 3vw, 34px);
  color: #fff;
}

.fn-story-content h1,
.fn-story-content h2,
.fn-story-content h3 {
  margin: 10px 0 9px;
  font-family: var(--fn-global-font);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.fn-story-main h1 {
  max-width: 820px;
  font-size: clamp(2rem, 4vw, 4rem);
}

.fn-story-secondary h2 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.fn-category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--fn-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fn-category-badge:hover {
  color: #fff;
  background: var(--fn-accent-strong);
}

.fn-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--fn-muted);
  font-size: 0.82rem;
}

.fn-story-overlay .fn-meta {
  color: rgba(255,255,255,0.82);
}

.fn-meta a:hover {
  color: currentColor;
  text-decoration: underline;
}

/* Trending */
.fn-trending-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fn-trending-card {
  display: grid;
  grid-template-columns: 42px 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.fn-trending-number {
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 900;
  color: #d1d5db;
}

.fn-trending-card img {
  width: 78px;
  height: 74px;
  object-fit: cover;
  border-radius: 11px;
}

.fn-trending-card h3 {
  margin: 0 0 5px;
  font-size: 0.94rem;
  line-height: 1.35;
}

/* Main homepage content */
.fn-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 28px;
}

.fn-news-list {
  display: grid;
  gap: 16px;
}

.fn-news-card {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 20px;
  padding: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fn-news-card:hover,
.fn-grid-card:hover,
.fn-sidebar-post:hover {
  transform: translateY(-2px);
  box-shadow: var(--fn-shadow-md);
}

.fn-news-card-thumb {
  min-height: 188px;
  overflow: hidden;
  border-radius: 13px;
  background: #e5e7eb;
}

.fn-news-card-thumb img {
  width: 100%;
  height: 100%;
  min-height: 188px;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.fn-news-card:hover img,
.fn-grid-card:hover img {
  transform: scale(1.025);
}

.fn-news-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5px 6px 5px 0;
}

.fn-news-card h2,
.fn-news-card h3,
.fn-grid-card h3 {
  margin: 8px 0 8px;
  font-family: var(--fn-global-font);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.fn-news-card h2,
.fn-news-card h3 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.fn-excerpt {
  margin: 0 0 12px;
  color: var(--fn-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* Category grids */
.fn-category-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
}

.fn-category-featured .fn-story-overlay {
  min-height: 430px;
}

.fn-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fn-grid-card {
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fn-grid-card-thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #e5e7eb;
}

.fn-grid-card-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.fn-grid-card-body {
  padding: 14px;
}

.fn-grid-card h3 {
  font-size: 1.04rem;
}

/* Sidebar and widgets */
.widget-area {
  display: grid;
  gap: 18px;
}

.widget {
  padding: 20px;
}

.widget-title {
  margin: 0 0 14px;
  font-family: var(--fn-global-font);
  font-size: 1.25rem;
  line-height: 1.25;
}

.widget ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget li + li {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--fn-border);
}

.fn-sticky-sidebar {
  position: sticky;
  top: 86px;
}

.admin-bar .fn-sticky-sidebar {
  top: 118px;
}

.fn-sidebar-posts {
  display: grid;
  gap: 10px;
}

.fn-sidebar-post {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--fn-surface-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fn-sidebar-post img {
  width: 82px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
}

.fn-sidebar-post h4 {
  margin: 0 0 5px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.fn-widget-zone {
  margin-top: 26px;
}

.fn-widget-zone .widget + .widget {
  margin-top: 16px;
}

/* Pagination */
.navigation.pagination {
  margin-top: 26px;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.page-numbers {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--fn-border);
  background: #fff;
  font-weight: 750;
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--fn-text);
  border-color: var(--fn-text);
  color: #fff;
}

/* Single post */
.fn-single-wrap {
  margin-top: 24px;
}

.fn-single-header {
  max-width: 970px;
  margin: 0 auto 22px;
  text-align: center;
}

.fn-single-header .fn-category-badge {
  margin-bottom: 12px;
}

.fn-entry-title {
  margin: 0 0 16px;
  font-family: var(--fn-global-font);
  font-size: clamp(2.3rem, 5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.fn-single-header .fn-meta {
  justify-content: center;
}

.fn-featured-banner {
  overflow: hidden;
  border-radius: var(--fn-radius-xl);
  box-shadow: var(--fn-shadow-lg);
  background: #e5e7eb;
}

.fn-featured-banner img {
  width: 100%;
  max-height: 680px;
  display: block;
  object-fit: cover;
}

.fn-single-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 32px;
  margin-top: 30px;
}

.fn-article-card {
  padding: clamp(24px, 5vw, 56px);
}

.entry-content {
  max-width: var(--fn-reading);
  margin-inline: auto;
  font-family: var(--fn-global-font);
  font-size: 1.1rem;
  line-height: 1.85;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--fn-text);
  line-height: 1.25;
}

.entry-content h2 {
  margin-top: 2.2em;
  font-size: 2rem;
}

.entry-content h3 {
  margin-top: 1.9em;
  font-size: 1.5rem;
}

.entry-content a {
  color: var(--fn-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content blockquote {
  margin: 2rem 0;
  padding: 1.3rem 1.5rem;
  border-left: 4px solid var(--fn-accent);
  border-radius: 0 14px 14px 0;
  background: var(--fn-surface-soft);
  font-size: 1.2rem;
  font-style: italic;
}

.entry-content img {
  border-radius: 16px;
}

.entry-content .alignwide {
  width: min(1100px, calc(100vw - 48px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.entry-content .alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.fn-tags {
  max-width: var(--fn-reading);
  margin: 28px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fn-tags a {
  display: inline-flex;
  padding: 6px 11px;
  border: 1px solid var(--fn-border);
  border-radius: 999px;
  background: var(--fn-surface-soft);
  color: var(--fn-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.fn-author-box {
  max-width: var(--fn-reading);
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border-radius: 16px;
  background: var(--fn-surface-soft);
}

.fn-author-box img {
  border-radius: 50%;
}

.fn-author-box h3 {
  margin: 0 0 5px;
}

.fn-author-box p {
  margin: 0;
  color: var(--fn-muted);
}

.fn-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* Archive/page */
.fn-page-header {
  padding: 28px;
  margin: 22px 0;
}

.fn-page-header h1 {
  margin: 0 0 6px;
  font-family: var(--fn-global-font);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.1;
}

.fn-page-header p {
  margin: 0;
  color: var(--fn-muted);
}

.fn-page-content {
  padding: clamp(24px, 5vw, 52px);
}

/* Comments */
.comments-area {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 38px);
}

.comments-title {
  margin-top: 0;
  font-family: var(--fn-global-font);
}

.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-body {
  padding: 18px 0;
  border-bottom: 1px solid var(--fn-border);
}

.comment-meta {
  font-size: 0.88rem;
}

/* Footer */
.site-footer {
  margin-top: 46px;
  padding-bottom: 24px;
}

.fn-footer-main {
  padding: 34px;
  background: #111318;
  color: #d1d5db;
  border: 0;
}

.fn-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 28px;
}

.fn-footer-main h2,
.fn-footer-main h3,
.fn-footer-main .widget-title {
  color: #fff;
}

.fn-footer-main .widget {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.fn-footer-main .widget li + li {
  border-color: rgba(255,255,255,0.1);
}

.fn-footer-main a:hover {
  color: #fff;
}

.fn-footer-brand .site-title {
  color: #fff;
  font-size: 1.8rem;
}

.fn-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 4px 0;
  color: var(--fn-muted);
  font-size: 0.85rem;
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Empty states */
.fn-empty {
  padding: 34px;
  text-align: center;
}

.fn-placeholder {
  width: 100%;
  height: 100%;
  min-height: 160px;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

/* WordPress defaults */
.wp-caption,
.gallery-caption {
  max-width: 100%;
}

.sticky {
  outline: 2px solid color-mix(in srgb, var(--fn-accent) 20%, transparent);
}

.bypostauthor {
  font-weight: inherit;
}

.alignleft {
  float: left;
  margin: 0 1.5rem 1rem 0;
}

.alignright {
  float: right;
  margin: 0 0 1rem 1.5rem;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive */
@media (max-width: 1100px) {
  .fn-trending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fn-content-grid,
  .fn-single-grid {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .fn-category-layout {
    grid-template-columns: 1fr;
  }

  .fn-category-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-bar .fn-nav-wrap {
    top: 46px;
  }

  .fn-header-main {
    grid-template-columns: 1fr;
  }

  .fn-header-ad {
    min-height: 64px;
  }

  .fn-hero-grid,
  .fn-content-grid,
  .fn-single-grid {
    grid-template-columns: 1fr;
  }

  .fn-hero-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .fn-story-overlay.fn-story-main {
    min-height: 480px;
  }

  .fn-sticky-sidebar {
    position: static;
  }

  .fn-category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fn-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-shell,
  .fn-container {
    width: min(calc(100% - 22px), var(--fn-container));
  }

  .fn-topbar-inner,
  .fn-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 8px 0;
  }

  .fn-social-links {
    display: none;
  }

  .fn-navigation {
    flex-wrap: wrap;
    padding: 8px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .primary-menu-container {
    display: none;
    order: 3;
    width: 100%;
    padding-top: 8px;
  }

  .primary-menu-container.is-open {
    display: block;
  }

  .primary-menu {
    display: grid;
    width: 100%;
  }

  .primary-menu > li > a {
    width: 100%;
  }

  .primary-menu .sub-menu {
    position: static;
    display: block;
    min-width: 0;
    margin: 0 0 0 14px;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .fn-breaking {
    grid-template-columns: 1fr;
  }

  .fn-breaking-label {
    min-height: 34px;
    justify-content: center;
  }

  .fn-hero-secondary {
    grid-template-columns: 1fr;
  }

  .fn-story-overlay.fn-story-main {
    min-height: 430px;
  }

  .fn-story-overlay {
    min-height: 270px;
  }

  .fn-trending-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 5px;
  }

  .fn-trending-card {
    flex: 0 0 88%;
    scroll-snap-align: start;
  }

  .fn-news-card {
    grid-template-columns: 1fr;
  }

  .fn-news-card-thumb,
  .fn-news-card-thumb img {
    min-height: 220px;
  }

  .fn-news-card-body {
    padding: 2px 4px 7px;
  }

  .fn-category-featured .fn-story-overlay {
    min-height: 390px;
  }

  .fn-related-grid {
    grid-template-columns: 1fr;
  }

  .fn-entry-title {
    font-size: clamp(2.1rem, 11vw, 3.5rem);
  }

  .fn-featured-banner {
    border-radius: 20px;
  }

  .fn-article-card {
    padding: 24px 18px;
  }

  .entry-content {
    font-size: 1.03rem;
  }
}

@media (max-width: 520px) {
  .fn-header-main {
    padding: 16px;
  }

  .fn-header-ad {
    display: none;
  }

  .fn-category-list,
  .fn-footer-grid {
    grid-template-columns: 1fr;
  }

  .fn-author-box {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .fn-author-box img {
    margin-inline: auto;
  }

  .search-form {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* --------------------------------------------------------------------------
   FableNews 1.1 — Clean white editorial interface
   -------------------------------------------------------------------------- */
:root {
  --fn-bg: #ffffff;
  --fn-surface: #ffffff;
  --fn-surface-soft: #fafbfc;
  --fn-text: #13161b;
  --fn-muted: #737b87;
  --fn-border: #e9edf1;
  --fn-accent: #087f72;
  --fn-accent-strong: #06695f;
  --fn-danger: #df1017;
  --fn-radius-sm: 12px;
  --fn-radius-md: 18px;
  --fn-radius-lg: 22px;
  --fn-radius-xl: 28px;
  --fn-shadow-sm: 0 8px 24px rgba(22, 31, 44, 0.055);
  --fn-shadow-md: 0 16px 38px rgba(22, 31, 44, 0.085);
  --fn-shadow-lg: 0 24px 58px rgba(22, 31, 44, 0.12);
  --fn-container: 1320px;
}

body {
  background:
    radial-gradient(circle at 50% -180px, #f7f9fb 0, rgba(247,249,251,0) 430px),
    #ffffff;
}

.fn-card {
  border-color: var(--fn-border);
  box-shadow: var(--fn-shadow-sm);
}

.fn-section {
  margin-top: 26px;
}

.fn-section-header {
  margin-bottom: 15px;
}

.fn-section-title {
  font-size: clamp(1.55rem, 2vw, 2rem);
}

/* Single-row premium header: logo, navigation and search. */
.site-header {
  padding: 14px 0 2px;
}

.fn-header-shell {
  position: relative;
}

.fn-navigation {
  position: relative;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(72px, 1fr);
  align-items: center;
  gap: 26px;
  padding: 0 18px 0 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-branding {
  display: flex;
  align-items: center;
}

.site-title {
  font-family: var(--fn-global-font);
  font-size: clamp(1.85rem, 2.7vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.055em;
}

.site-description {
  display: none;
}

.custom-logo {
  max-height: 50px;
}

.primary-menu-container {
  justify-self: center;
}

.primary-menu {
  justify-content: center;
  gap: 9px;
}

.primary-menu > li > a {
  position: relative;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 0;
  background: transparent !important;
  color: #171a20;
  font-family: var(--fn-global-font);
  font-size: 0.97rem;
  font-weight: 700;
}

.primary-menu > li > a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: var(--fn-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}

.primary-menu > li.current-menu-item > a,
.primary-menu > li.current_page_item > a,
.primary-menu > li > a:hover {
  color: var(--fn-accent);
}

.primary-menu > li.current-menu-item > a::after,
.primary-menu > li.current_page_item > a::after,
.primary-menu > li > a:hover::after {
  transform: scaleX(1);
}

.fn-nav-actions {
  justify-self: end;
  margin-left: 0;
  padding-left: 16px;
  border-left: 1px solid var(--fn-border);
}

.fn-search-toggle {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: transparent;
  color: var(--fn-text);
}

.fn-search-toggle:hover,
.fn-search-toggle:focus-visible {
  background: var(--fn-surface-soft);
  color: var(--fn-accent);
  transform: none;
}

.fn-search-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 120;
  width: min(440px, 100%);
  margin-top: 0;
  padding: 13px;
  border-radius: 16px;
}

.fn-menu-icon {
  display: grid;
  gap: 4px;
}

.fn-menu-icon span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

/* Airier ticker with separated red badge and navigation arrows. */
.fn-breaking {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 58px;
  margin-top: 16px;
  padding: 8px 10px;
  border-radius: 17px;
}

.fn-breaking-label {
  align-self: center;
  min-height: 36px;
  padding: 0 17px;
  border-radius: 9px;
  font-size: .74rem;
  letter-spacing: .03em;
}

.fn-breaking-track {
  min-height: 40px;
  padding: 0 22px;
}

.fn-breaking-item {
  font-family: var(--fn-global-font);
  font-size: .98rem;
  font-weight: 700;
}

.fn-breaking-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.fn-breaking-control {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: #3b414a;
  font-size: 1.5rem;
  line-height: 1;
}

.fn-breaking-control:hover {
  background: var(--fn-surface-soft);
  color: var(--fn-accent);
  transform: none;
}

/* Editorial hero. */
.fn-hero-grid {
  grid-template-columns: minmax(0, 1.76fr) minmax(360px, .92fr);
  gap: 20px;
}

.fn-story-overlay {
  border-radius: 20px;
}

.fn-story-overlay.fn-story-main {
  min-height: 430px;
}

.fn-story-main h1 {
  max-width: 690px;
  font-size: clamp(2.15rem, 3.7vw, 3.45rem);
}

.fn-story-content {
  padding: clamp(22px, 3vw, 32px);
}

.fn-category-badge {
  min-height: 25px;
  padding: 0 11px;
  font-size: .66rem;
  letter-spacing: .055em;
}

.fn-hero-secondary {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.fn-hero-side-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(150px, 42%) minmax(0, 1fr);
  align-items: center;
  gap: 19px;
  padding: 12px;
  overflow: hidden;
  border-radius: 19px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.fn-hero-side-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--fn-shadow-md);
}

.fn-hero-side-thumb {
  display: block;
  height: 100%;
  min-height: 168px;
  overflow: hidden;
  border-radius: 14px;
  background: #f4f6f8;
}

.fn-hero-side-thumb img,
.fn-hero-side-thumb .fn-placeholder {
  width: 100%;
  height: 100%;
  min-height: 168px;
  display: block;
  object-fit: cover;
}

.fn-hero-side-body {
  min-width: 0;
  padding-right: 8px;
}

.fn-hero-side-body h2 {
  margin: 12px 0 18px;
  font-family: var(--fn-global-font);
  font-size: clamp(1.12rem, 1.55vw, 1.48rem);
  line-height: 1.25;
  letter-spacing: -.018em;
}

/* Placeholder art resembles a quiet editorial image card. */
.fn-placeholder {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #f1f3f5, #fafbfc);
}

.fn-placeholder::before {
  content: "";
  position: absolute;
  left: 21%;
  right: 17%;
  bottom: 18%;
  height: 42%;
  background: #e1e5e9;
  clip-path: polygon(0 100%, 35% 34%, 53% 67%, 72% 42%, 100% 100%);
}

.fn-placeholder::after {
  content: "";
  position: absolute;
  left: 22%;
  top: 24%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #dfe3e7;
}

/* Compact trending row. */
.fn-trending-grid {
  gap: 16px;
}

.fn-trending-card {
  min-height: 91px;
  grid-template-columns: 44px 72px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 13px;
  border-radius: 17px;
}

.fn-trending-number {
  color: #cfd4da;
  font-family: var(--fn-global-font);
  font-size: 1.7rem;
  font-weight: 700;
}

.fn-trending-card > a {
  height: 66px;
  overflow: hidden;
  border-radius: 12px;
  background: #f4f6f8;
}

.fn-trending-card img,
.fn-trending-card .fn-placeholder {
  width: 72px;
  height: 66px;
  min-height: 66px;
  object-fit: cover;
}

.fn-trending-card h3 {
  font-family: var(--fn-global-font);
  font-size: .9rem;
  line-height: 1.32;
}

/* Latest news and popular widget. */
.fn-content-grid {
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 26px;
}

.fn-news-card {
  grid-template-columns: minmax(230px, 34%) minmax(0, 1fr);
  gap: 21px;
  padding: 12px;
  border-radius: 18px;
}

.fn-news-card-thumb,
.fn-news-card-thumb img {
  min-height: 174px;
  border-radius: 14px;
}

.fn-news-card-body {
  padding-right: 12px;
}

.widget {
  border-radius: 18px;
}

.fn-popular-widget {
  padding: 24px 25px;
}

.fn-popular-widget .widget-title {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.fn-sidebar-posts {
  gap: 0;
}

.fn-sidebar-post {
  grid-template-columns: 11px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-radius: 0;
  background: transparent;
  border-top: 1px solid var(--fn-border);
}

.fn-sidebar-post:first-child {
  border-top: 0;
}

.fn-sidebar-post:hover {
  transform: none;
  box-shadow: none;
}

.fn-sidebar-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--fn-accent);
}

.fn-sidebar-post h4 {
  margin: 0 0 5px;
  font-size: .94rem;
  line-height: 1.4;
}

/* Category cards retain the white visual language. */
.fn-category-featured .fn-story-overlay {
  min-height: 410px;
}

.fn-grid-card {
  border-radius: 17px;
}

.fn-grid-card-thumb {
  background: #f4f6f8;
}

/* Single articles use a clean white canvas and rounded hero banner. */
.fn-featured-banner {
  border-radius: 24px;
  box-shadow: var(--fn-shadow-md);
}

.fn-article-card {
  border-radius: 22px;
}

/* A quieter footer that remains consistent with the homepage. */
.fn-footer-main {
  background: #14171c;
  border-radius: 24px;
  box-shadow: var(--fn-shadow-lg);
}

@media (max-width: 1100px) {
  .fn-navigation {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
  }

  .primary-menu {
    gap: 1px;
  }

  .primary-menu > li > a {
    padding-inline: 8px;
    font-size: .91rem;
  }

  .fn-hero-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr);
  }

  .fn-hero-side-card {
    grid-template-columns: 42% minmax(0, 1fr);
    gap: 13px;
  }

  .fn-content-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 900px) {
  .fn-navigation {
    min-height: 68px;
    display: flex;
    justify-content: space-between;
    padding: 0 13px 0 18px;
  }

  .menu-toggle {
    order: 3;
    display: inline-flex;
    width: 44px;
    height: 44px;
    margin-left: 4px;
    background: var(--fn-surface-soft);
    color: var(--fn-text);
  }

  .fn-nav-actions {
    order: 2;
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }

  .primary-menu-container {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 130;
    display: none;
    padding: 10px;
    border: 1px solid var(--fn-border);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--fn-shadow-md);
  }

  .primary-menu-container.is-open {
    display: block;
  }

  .primary-menu {
    display: grid;
  }

  .primary-menu > li > a {
    width: 100%;
    padding: 0 12px;
    border-radius: 10px;
  }

  .primary-menu > li > a::after {
    display: none;
  }

  .primary-menu > li.current-menu-item > a,
  .primary-menu > li.current_page_item > a,
  .primary-menu > li > a:hover {
    background: var(--fn-surface-soft) !important;
  }

  .fn-hero-grid,
  .fn-content-grid {
    grid-template-columns: 1fr;
  }

  .fn-hero-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .fn-hero-side-card {
    grid-template-columns: 42% minmax(0, 1fr);
  }

  .fn-sticky-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-shell,
  .fn-container {
    width: min(calc(100% - 22px), var(--fn-container));
  }

  .site-title {
    font-size: 1.75rem;
  }

  .fn-breaking {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fn-breaking-controls {
    display: none;
  }

  .fn-breaking-track {
    padding-inline: 13px;
  }

  .fn-story-overlay.fn-story-main {
    min-height: 420px;
  }

  .fn-hero-secondary {
    grid-template-columns: 1fr;
  }

  .fn-hero-side-card {
    min-height: 174px;
  }

  .fn-trending-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }

  .fn-trending-card {
    flex: 0 0 min(330px, 88vw);
    scroll-snap-align: start;
  }

  .fn-news-card {
    grid-template-columns: 1fr;
  }

  .fn-news-card-thumb,
  .fn-news-card-thumb img {
    min-height: 220px;
  }
}

@media (max-width: 520px) {
  .fn-navigation {
    border-radius: 15px;
  }

  .fn-search-toggle,
  .menu-toggle {
    width: 40px;
    height: 40px;
  }

  .fn-breaking {
    min-height: 54px;
    padding: 7px;
    border-radius: 15px;
  }

  .fn-breaking-label {
    min-height: 34px;
    padding-inline: 12px;
    font-size: .68rem;
  }

  .fn-hero-side-card {
    grid-template-columns: 120px minmax(0, 1fr);
    padding: 10px;
  }

  .fn-hero-side-thumb,
  .fn-hero-side-thumb img,
  .fn-hero-side-thumb .fn-placeholder {
    min-height: 136px;
  }

  .fn-hero-side-body h2 {
    margin: 8px 0 10px;
    font-size: 1rem;
  }

  .fn-category-layout,
  .fn-category-list {
    grid-template-columns: 1fr;
  }
}


/* Typography update */
body,
input,
textarea,
select{
  font-family: var(--fn-global-font);
}

h1,h2,h3,h4,h5,h6,
.site-title,
.main-navigation,
.main-navigation a,
button,
.wp-element-button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.button,
.btn,
.read-more,
.menu{
  font-family: var(--fn-global-font);
}
