/*
Theme Name: FM Magazine GigWise Style
Theme URI: https://fmmagazine.co.uk/
Author: FM Magazine
Author URI: https://fmmagazine.co.uk/
Description: A clean print-magazine theme for FM Magazine in the layout style of a classic editorial homepage: centered single column, no sidebar, white background, black text, orange-red accents, three-column newspaper head section, grid cards and a dark feature band. No plugins required.
Version: 1.0.4
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fm-magazine-gigwise
Tags: blog, magazine, news, one-column, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* =Reset & tokens
----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --fm-bg: #ffffff;
  --fm-text: #111111;
  --fm-muted: #666666;
  --fm-accent: #e8442e;
  --fm-rule: #111111;
  --fm-rule-soft: #dddddd;
  --fm-panel: #eef3f1;
  --fm-dark: #111111;
  --fm-dark-text: #ffffff;
  --fm-font: "Nunito", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
[data-theme="dark"] {
  --fm-bg: #141414;
  --fm-text: #f2f2f2;
  --fm-muted: #aaaaaa;
  --fm-rule: #f2f2f2;
  --fm-rule-soft: #333333;
  --fm-panel: #1f2422;
  --fm-dark: #000000;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fm-bg);
  color: var(--fm-text);
  font-family: var(--fm-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--fm-text); text-decoration: none; }
a:hover { color: var(--fm-accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* =Scroll progress
----------------------------------------------- */
.fm-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--fm-accent); width: 0; z-index: 1000; }

/* =Masthead (centered, GigWise-style)
----------------------------------------------- */
.fm-masthead { text-align: center; padding: 28px 0 0; }
.fm-wordmark { font-weight: 900; font-size: clamp(46px, 7vw, 84px); line-height: 1; letter-spacing: -0.02em; margin: 0; }
.fm-logo { text-align: center; }
.fm-logo img { max-height: 120px; width: auto; height: auto; margin: 0 auto; }
[data-theme="dark"] .fm-logo img { filter: invert(1) hue-rotate(180deg); }
.fm-wordmark a { color: var(--fm-text); }
.fm-wordmark .fm-dot { color: var(--fm-accent); }
.fm-tagline { color: var(--fm-muted); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin: 8px 0 0; }
.fm-actions { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 18px 0 20px; }
.fm-pill { border: 1px solid var(--fm-rule-soft); background: transparent; color: var(--fm-text); border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 700; }
.fm-pill:hover { border-color: var(--fm-accent); color: var(--fm-accent); }
.fm-pill .fm-count { background: var(--fm-accent); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 6px; font-size: 12px; }
.fm-round-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--fm-rule-soft); background: transparent; color: var(--fm-text); font-size: 17px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.fm-round-btn:hover { border-color: var(--fm-accent); color: var(--fm-accent); }
.fm-search-form { display: none; max-width: 420px; margin: 0 auto 18px; }
.fm-search-form.open { display: flex; }
.fm-search-form input[type="search"] { flex: 1; padding: 10px 14px; border: 1px solid var(--fm-rule-soft); border-right: 0; font-size: 15px; background: var(--fm-bg); color: var(--fm-text); }
.fm-search-form button { background: var(--fm-dark); color: #fff; border: 0; padding: 10px 18px; font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }

/* =Sticky nav (white, uppercase, double rule)
----------------------------------------------- */
.fm-nav { position: sticky; top: 0; z-index: 900; background: var(--fm-bg); border-top: 4px solid var(--fm-rule); border-bottom: 5px double var(--fm-rule); }
.fm-nav-inner { display: flex; align-items: center; justify-content: center; gap: 8px; }
.fm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.fm-nav li { margin: 0; }
.fm-nav a { display: block; padding: 13px 14px; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--fm-text); }
.fm-nav a:hover { color: var(--fm-accent); }
.fm-nav .current-menu-item a, .fm-nav .current-category a { background: var(--fm-accent); color: #fff; border-radius: 999px; padding: 6px 14px; margin: 7px 0; }
.fm-burger { display: none; background: none; border: 0; color: var(--fm-text); font-size: 26px; padding: 10px 14px; }

/* =Mobile drawer (display:none when closed)
----------------------------------------------- */
.fm-drawer { display: none; position: fixed; inset: 0 auto 0 0; width: 300px; max-width: 85vw; background: var(--fm-bg); z-index: 1100; box-shadow: 4px 0 24px rgba(0,0,0,.25); padding: 20px; overflow-y: auto; }
.fm-drawer.open { display: block; animation: fm-slide-in .25s ease-out; }
@keyframes fm-slide-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .fm-drawer.open { animation: none; } }
.fm-drawer-close { background: none; border: 0; font-size: 26px; color: var(--fm-text); float: right; }
.fm-drawer ul { list-style: none; margin: 40px 0 0; padding: 0; }
.fm-drawer li { border-bottom: 1px solid var(--fm-rule-soft); }
.fm-drawer a { display: block; padding: 12px 4px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }
.fm-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1050; }
.fm-overlay.open { display: block; }

/* =Ticker
----------------------------------------------- */
.fm-ticker { background: var(--fm-dark); color: #fff; overflow: hidden; white-space: nowrap; }
.fm-ticker-label { display: inline-block; background: var(--fm-accent); color: #fff; font-weight: 900; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 14px; position: relative; z-index: 2; }
.fm-ticker-track { display: inline-block; padding-left: 20px; animation: fm-tick 40s linear infinite; }
.fm-ticker-track a { color: #fff; font-size: 14px; margin-right: 48px; }
@keyframes fm-tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =Section headings (double rule, centered, arrow)
----------------------------------------------- */
.fm-section { padding: 44px 0 8px; }
.fm-section-head { text-align: center; margin-bottom: 28px; }
.fm-double-rule { border: 0; border-top: 1px solid var(--fm-rule); position: relative; height: 4px; margin: 0 0 16px; }
.fm-double-rule::after { content: ""; display: block; border-top: 1px solid var(--fm-rule); margin-top: 2px; }
.fm-section-head h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.fm-section-head h2 .fm-arrow { color: var(--fm-accent); }
.fm-see-all { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border-bottom: 2px solid var(--fm-accent); padding-bottom: 2px; }

/* =Category labels, titles, bylines
----------------------------------------------- */
.fm-cat { display: inline-block; color: var(--fm-accent); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.fm-byline { color: var(--fm-muted); font-size: 13px; }
.fm-byline a { color: var(--fm-muted); }
.fm-excerpt { color: var(--fm-muted); font-size: 15px; }

/* =Head section (3 columns, newspaper style)
----------------------------------------------- */
.fm-head { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 32px; align-items: start; padding: 32px 0 8px; }
.fm-head h3.fm-col-head { font-size: 15px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; border-top: 3px double var(--fm-rule); border-bottom: 1px solid var(--fm-rule-soft); padding: 10px 0; margin-bottom: 16px; }
.fm-mini-card { display: flex; gap: 14px; margin-bottom: 18px; }
.fm-mini-card .fm-thumb { flex: 0 0 96px; }
.fm-mini-card .fm-thumb img { width: 96px; height: 72px; object-fit: cover; aspect-ratio: 4 / 3; }
.fm-mini-card h4 { font-size: 15px; font-weight: 700; margin: 4px 0; }
.fm-featured img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.fm-featured h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; margin: 14px 0 8px; }
.fm-picks { background: var(--fm-panel); padding: 20px; }
.fm-picks h3.fm-col-head { border-top: 0; margin-top: 0; }
.fm-pick { display: flex; gap: 12px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--fm-rule-soft); }
.fm-pick:last-child { border-bottom: 0; }
.fm-pick h4 { font-size: 14px; font-weight: 700; margin: 4px 0; }
.fm-pick .fm-thumb { flex: 0 0 72px; }
.fm-pick .fm-thumb img { width: 72px; height: 54px; object-fit: cover; }

/* =Grid cards (image top, 16:10)
----------------------------------------------- */
.fm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.fm-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.fm-card h3 { font-size: 19px; font-weight: 700; margin: 10px 0 4px; }
.fm-card.is-hidden { display: none; }
.fm-filters { text-align: center; margin-bottom: 24px; }
.fm-chip { border: 1px solid var(--fm-rule-soft); background: transparent; color: var(--fm-text); border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700; margin: 3px; }
.fm-chip.active, .fm-chip:hover { background: var(--fm-dark); color: #fff; border-color: var(--fm-dark); }
.fm-load-wrap { text-align: center; padding: 28px 0; }
.fm-btn { background: var(--fm-dark); color: #fff; border: 0; padding: 13px 34px; font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.fm-btn:hover { background: var(--fm-accent); color: #fff; }

/* =Most Read (numbered) + Big Read (dark band)
----------------------------------------------- */
.fm-most-read { counter-reset: fm-rank; max-width: 720px; margin: 0 auto; }
.fm-most-read li { display: flex; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--fm-rule-soft); counter-increment: fm-rank; list-style: none; }
.fm-most-read li::before { content: counter(fm-rank, decimal-leading-zero); font-weight: 900; font-size: 30px; color: var(--fm-accent); line-height: 1; }
.fm-most-read h3 { font-size: 18px; margin: 2px 0; }
.fm-most-read-thumb { flex-shrink: 0; }
.fm-most-read-thumb img { display: block; width: 110px; height: 80px; object-fit: cover; border-radius: 4px; }
@media (max-width: 640px) { .fm-most-read-thumb img { width: 84px; height: 62px; } }
.fm-bigread { background: var(--fm-dark); color: var(--fm-dark-text); padding: 56px 0; margin-top: 44px; }
.fm-bigread a { color: var(--fm-dark-text); }
.fm-bigread a:hover { color: var(--fm-accent); }
.fm-bigread-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; }
.fm-bigread img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.fm-bigread h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.fm-bigread .fm-excerpt { color: #cccccc; }

/* =FM Rated (score badges)
----------------------------------------------- */
.fm-rated { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.fm-rated-card { position: relative; }
.fm-rated-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.fm-score { position: absolute; top: 10px; right: 10px; background: var(--fm-accent); color: #fff; font-weight: 900; font-size: 20px; padding: 6px 12px; }
.fm-rated-card h3 { font-size: 18px; margin: 10px 0 4px; }

/* =Category tiles + newsletter
----------------------------------------------- */
.fm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.fm-tile { border: 1px solid var(--fm-rule-soft); padding: 26px 18px; text-align: center; }
.fm-tile-img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 50%; margin: 0 auto 14px; }
.fm-tile span.fm-tile-initial { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 14px; background: var(--fm-panel); color: var(--fm-accent); font-size: 36px; font-weight: 900; }
.fm-tile h3 { font-size: 16px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 4px; }
.fm-tile span { color: var(--fm-muted); font-size: 13px; }
.fm-newsletter { background: var(--fm-panel); padding: 40px 20px; text-align: center; margin-top: 44px; }
.fm-newsletter h2 { font-size: 26px; font-weight: 900; text-transform: uppercase; }
.fm-newsletter form { display: flex; gap: 0; max-width: 480px; margin: 18px auto 0; }
.fm-newsletter input[type="email"] { flex: 1; padding: 12px 14px; border: 1px solid var(--fm-rule-soft); border-right: 0; font-size: 15px; background: var(--fm-bg); color: var(--fm-text); }
.fm-newsletter button { background: var(--fm-dark); color: #fff; border: 0; padding: 12px 22px; font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.fm-notice { text-align: center; color: var(--fm-accent); font-weight: 700; margin-top: 14px; }

/* =Lists (archive/search), single, pages
----------------------------------------------- */
.fm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.fm-list-card { display: flex; gap: 20px; }
.fm-list-card .fm-thumb { flex: 0 0 33%; }
.fm-list-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.fm-list-card h3 { font-size: 20px; margin: 6px 0 4px; }
.fm-archive-head { padding: 32px 0 0; text-align: center; }
.fm-archive-head h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 900; text-transform: uppercase; }
.fm-single { max-width: 780px; margin: 0 auto; padding: 36px 20px; }
.fm-single h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; }
.fm-single .fm-single-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 18px 0; }
.fm-single .entry-content { font-size: 17px; }
.fm-single .entry-content img { height: auto; }
.fm-page { max-width: 860px; margin: 0 auto; padding: 36px 20px; }
.fm-page h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; }
.fm-pagination { text-align: center; padding: 28px 0; font-weight: 700; }
.fm-pagination a, .fm-pagination span { padding: 6px 12px; }
.fm-pagination .current { background: var(--fm-dark); color: #fff; }

/* =Quick-view modal
----------------------------------------------- */
.fm-modal { display: none; position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.6); align-items: center; justify-content: center; padding: 20px; }
.fm-modal.open { display: flex; }
.fm-modal-box { background: var(--fm-bg); color: var(--fm-text); max-width: 680px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px; position: relative; }
.fm-modal-box img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 14px; }
.fm-modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 26px; color: var(--fm-text); }

/* =Footer
----------------------------------------------- */
.fm-footer { margin-top: 34px; border-top: 1px solid #E8DDCC; background: #F6F0E6; }
.fm-footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 20px; padding: 26px 20px 30px; }
.fm-footer-brand { font-family: "Playfair Display", Georgia, serif; font-size: 28px; text-align: left; color: #16130E; }
.fm-footer-desc { color: #6B6255; font-size: 14px; max-width: 340px; }
.fm-footer-contact { font-size: 13px; color: #6B6255; }
.fm-footer h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #16130E; }
.fm-footer a { display: block; color: #6B6255; font-size: 14px; padding: 3px 0; }
.fm-copyright { border-top: 1px solid #E8DDCC; padding: 14px 20px; text-align: center; color: #6B6255; font-size: 13px; }
@media (max-width: 900px) { .fm-footer-grid { grid-template-columns: 1fr; } }

/* =Responsive
----------------------------------------------- */
@media (max-width: 1024px) {
  .fm-head { grid-template-columns: 1fr 1fr; }
  .fm-featured { grid-column: 1 / -1; order: -1; }
  .fm-grid, .fm-rated { grid-template-columns: 1fr 1fr; }
  .fm-bigread-inner { grid-template-columns: 1fr; }
  .fm-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .fm-nav-inner { justify-content: space-between; }
  .fm-nav ul { display: none; }
  .fm-burger { display: block; }
  .fm-head { grid-template-columns: 1fr; }
  .fm-featured { order: -1; }
  .fm-grid, .fm-rated, .fm-list, .fm-tiles { grid-template-columns: 1fr; }
  .fm-footer-grid { grid-template-columns: 1fr; }
  .fm-list-card { flex-direction: column; }
  .fm-list-card .fm-thumb { flex-basis: auto; }
  .fm-newsletter form { flex-direction: column; gap: 10px; }
  .fm-newsletter input[type="email"] { border-right: 1px solid var(--fm-rule-soft); }
}
/* =Related stories (single posts) */
.fm-related { padding: 36px 0 8px; border-top: 1px solid var(--fm-rule-soft); margin-top: 32px; }
.fm-related .fm-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .fm-related .fm-grid { grid-template-columns: 1fr; } }
/* =Breadcrumbs (single posts) */
.rank-math-breadcrumb { font-size: .85rem; color: #767676; margin: 0 0 12px; }
.rank-math-breadcrumb a { color: inherit; }
/* =Author box (single posts) */
.fm-author-box { display: flex; gap: 20px; padding: 28px 0; border-top: 1px solid var(--fm-rule-soft); margin-top: 32px; align-items: flex-start; }
.fm-author-box img.avatar { border-radius: 50%; flex-shrink: 0; }
.fm-author-box-text h2 { font-size: 1.1rem; margin: 0 0 4px; }
.fm-author-box-name { font-weight: 700; margin: 0 0 6px; }
.fm-author-box-text p { margin: 0 0 6px; }
@media (max-width: 640px) { .fm-author-box { flex-direction: column; } }
/* =Skip link (visible on focus) */
.skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; position: absolute; left: 12px; top: 12px; z-index: 1000; background: #fff; color: #111; padding: 10px 16px; }
/* =Comments */
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-body { padding: 16px 0; border-top: 1px solid var(--fm-rule-soft); }
.comment-author { font-weight: 700; }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-meta { font-size: .85rem; color: #767676; }
.comment-reply-link { font-size: .9rem; }
/* =Moved inline styles (T17) */
.fm-post-nav { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0; border-top: 1px solid var(--fm-rule-soft); }
.fm-archive-grid { padding-top: 32px; }
/* =Live search input (moved from inline style, T17) */
.fm-live-search { padding:9px 14px;border:1px solid var(--fm-rule-soft);font-size:14px;max-width:280px;width:100%;margin-bottom:10px;background:var(--fm-bg);color:var(--fm-text); }
