/*
Theme Name: Tony Medeiros — Aggregator
Author: Tony Medeiros
Description: A flexible editorial portal framework for Sandbox World, Grubbits, MTLRestoRap and Tony Medeiros, with independent Gutenberg builders throughout.
Version: 2.2.6
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: tony-medeiros-aggregator
*/

html { scroll-behavior:smooth; }
body { margin:0; background:#f5f7fa; color:#111827; font-family:Arial,Helvetica,sans-serif; line-height:1.5; }
a { color:inherit; }

.tm-site-header { background:#fff; border-bottom:1px solid #d9dee5; }
.tm-header-inner { max-width:1320px; margin:0 auto; padding:22px 30px; }
.tm-site-title { display:block; font:800 42px/1 Arial,Helvetica,sans-serif; text-decoration:none; letter-spacing:-.04em; }
.tm-site-description { margin:7px 0 0; color:#667085; font-size:14px; }
.tm-header-blocks { margin-top:16px; }
.tm-header-blocks:empty { display:none; }
.tm-primary-nav { border-top:1px solid #e5e7eb; }
.tm-primary-nav ul { list-style:none; max-width:1320px; margin:0 auto; padding:0 30px; display:flex; flex-wrap:wrap; gap:24px; min-height:48px; align-items:center; }
.tm-primary-nav li { margin:0; }
.tm-primary-nav a { text-decoration:none; font-weight:700; font-size:14px; }
.tm-primary-nav a:hover { color:#c1121f; }

.tm-main-wrap { max-width:1320px; margin:0 auto; padding:30px 30px 70px; }
.tm-section { background:#fff; border:1px solid #e3e7ed; border-radius:18px; box-shadow:0 3px 14px rgba(16,24,40,.05); margin-bottom:22px; overflow:hidden; }
.tm-section-head { padding:22px 24px 16px; border-bottom:1px solid #e5e7eb; display:flex; justify-content:space-between; align-items:end; gap:20px; }
.tm-section-head h2 { margin:0; font-size:25px; line-height:1.15; letter-spacing:-.02em; }
.tm-section-head p { margin:0; color:#667085; font-size:14px; }
.tm-section-link { font-size:13px; font-weight:800; text-decoration:none; white-space:nowrap; }
.tm-section-link:hover { text-decoration:underline; }

/* Top Stories */
.tm-top-stories { padding:20px; }
.tm-top-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(360px,1fr); gap:22px; }
.tm-hero { min-width:0; }
.tm-hero-image { width:100%; aspect-ratio:16/9; object-fit:cover; display:block; border-radius:14px; }
.tm-source { display:inline-block; margin:14px 0 7px; font-size:12px; line-height:1; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.tm-source-sandbox { color:#1757a6; }
.tm-source-grubbits { color:#e45c00; }
.tm-source-mtl { color:#6a22a8; }
.tm-source-tony { color:#c1121f; }
.tm-hero h1 { margin:0 0 10px; font-size:39px; line-height:1.06; letter-spacing:-.035em; }
.tm-hero h1 a,.tm-side-story h3 a,.tm-card h3 a { text-decoration:none; }
.tm-hero-excerpt { margin:0; color:#475467; font-size:17px; max-width:850px; }
.tm-side-list { display:flex; flex-direction:column; }
.tm-side-story { display:grid; grid-template-columns:145px minmax(0,1fr); gap:15px; padding:0 0 16px; margin:0 0 16px; border-bottom:1px solid #e5e7eb; }
.tm-side-story:last-child { margin-bottom:0; padding-bottom:0; border-bottom:0; }
.tm-side-image { width:145px; height:104px; object-fit:cover; border-radius:11px; display:block; }
.tm-side-story h3 { margin:0 0 7px; font-size:19px; line-height:1.15; }
.tm-side-story p { margin:0; color:#667085; font-size:14px; line-height:1.35; }
.tm-empty { color:#667085; padding:20px 0; }

/* Publication builder areas */
.tm-publication-builder .tm-builder-slot { margin:0; border:0; border-radius:0; box-shadow:none; padding:20px; }
.tm-publication-builder .tm-builder-output { min-height:260px; }
.tm-builder-placeholder { min-height:220px; border:1px dashed #cbd5e1; border-radius:14px; background:#fafbfc; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:8px; padding:28px; box-sizing:border-box; color:#667085; }
.tm-builder-placeholder strong { color:#111827; font-size:20px; }
.tm-builder-placeholder span { max-width:620px; font-size:14px; }
.tm-site-feed { padding:20px; }
.tm-feed-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.tm-card { min-width:0; border:1px solid #e3e7ed; border-radius:13px; overflow:hidden; background:#fff; }
.tm-card-image-wrap { width:100%; aspect-ratio:16/9; overflow:hidden; background:#f3f4f6; }
.tm-card-image-wrap .tm-card-image { width:100%; height:100%; object-fit:cover; display:block; }
.tm-card-body { padding:12px 13px 14px; }
.tm-card h3 { margin:0; font-size:16px; line-height:1.18; letter-spacing:-.01em; }
.tm-card p { display:block; margin:8px 0 0; color:#667085; font-size:13px; line-height:1.35; min-height:2.7em; }
.tm-extra-builder .tm-builder-slot { margin:0; }

/* Builders */
.tm-builder-output { width:100%; box-sizing:border-box; }
.tm-builder-output > * { box-sizing:border-box; }
.tm-builder-output img { max-width:100%; height:auto; }
.tm-builder-output > .wp-block-group.alignfull,.tm-builder-output > .wp-block-columns.alignfull,.tm-builder-output > .wp-block-cover.alignfull { width:100%; max-width:none; }
.tm-builder-slot { background:#fff; border:1px solid #e3e7ed; border-radius:18px; padding:20px 24px; margin-bottom:22px; box-shadow:0 3px 14px rgba(16,24,40,.04); }
.tm-builder-slot:empty { display:none; }
.tm-builder-slot > *:first-child { margin-top:0; }
.tm-builder-slot > *:last-child { margin-bottom:0; }

/* Posts */
.tm-single-grid { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:30px; align-items:start; }
.tm-single { background:#fff; border:1px solid #e3e7ed; border-radius:18px; padding:28px; box-shadow:0 3px 14px rgba(16,24,40,.04); }
.tm-single-title { font-size:48px; line-height:1.08; letter-spacing:-.035em; margin:0 0 22px; }
.tm-single-featured img { width:100%; height:auto; display:block; border-radius:14px; margin-bottom:25px; }
.tm-entry-content { font-size:18px; }
.tm-entry-content img { max-width:100%; height:auto; border-radius:12px; }
.tm-sidebar { background:#fff; border:1px solid #e3e7ed; border-radius:18px; padding:20px; }
.tm-sidebar h2 { margin:0 0 18px; font-size:21px; }
.tm-sidebar-story { margin-bottom:22px; padding-bottom:22px; border-bottom:1px solid #e5e7eb; }
.tm-sidebar-story:last-child { margin-bottom:0; padding-bottom:0; border-bottom:0; }
.tm-sidebar-story img { width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:10px; display:block; margin-bottom:10px; }
.tm-sidebar-story h3 { margin:0; font-size:17px; line-height:1.2; }

/* Footer */
.tm-site-footer { background:#111827; color:#fff; margin-top:0; }
.tm-footer-inner { max-width:1320px; margin:0 auto; padding:34px 30px; }
.tm-footer-bottom { border-top:1px solid rgba(255,255,255,.15); max-width:1320px; margin:0 auto; padding:15px 30px; font-size:13px; color:#cbd5e1; }

/* Builder admin */
.tm-builder-admin .tm-builder-card { max-width:900px; background:#fff; border:1px solid #dcdcde; border-radius:12px; padding:24px; box-sizing:border-box; }

@media(max-width:1050px){
 .tm-top-grid{grid-template-columns:1fr;}
 .tm-feed-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
 .tm-single-grid{grid-template-columns:1fr;}
}
@media(max-width:700px){
 .tm-header-inner,.tm-main-wrap,.tm-footer-inner,.tm-footer-bottom{padding-left:16px;padding-right:16px;}
 .tm-primary-nav ul{padding-left:16px;padding-right:16px;gap:16px;}
 .tm-section-head{display:block;}
 .tm-section-head p{margin-top:7px;}
 .tm-section-link{display:inline-block;margin-top:10px;}
 .tm-top-stories,.tm-site-feed{padding:14px;}
 .tm-hero h1{font-size:32px;}
 .tm-side-story{grid-template-columns:100px minmax(0,1fr);}
 .tm-side-image{width:100px;height:80px;}
 .tm-feed-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
 .tm-single{padding:20px;}
 .tm-single-title{font-size:36px;}
}
@media(max-width:460px){
 .tm-feed-grid{grid-template-columns:1fr;}
 .tm-side-story{grid-template-columns:90px minmax(0,1fr);}
 .tm-side-image{width:90px;height:72px;}
}


/* Phase One: visual placeholders for feed-powered Top Stories. */
.tm-phase1-placeholder .tm-placeholder-media {
  min-height: 120px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  background:#f1f3f6;
  color:#6b7280;
  font-weight:700;
  text-align:center;
  padding:20px;
}
.tm-hero.tm-phase1-placeholder .tm-placeholder-media { min-height:320px; }
.tm-side-story.tm-phase1-placeholder .tm-placeholder-media { width:180px; min-height:120px; flex:0 0 180px; }
@media (max-width:700px){
 .tm-hero.tm-phase1-placeholder .tm-placeholder-media { min-height:220px; }
 .tm-side-story.tm-phase1-placeholder .tm-placeholder-media { width:120px; min-height:90px; flex-basis:120px; }
}


/* Feed Cache integration */
.tm-feed-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:16px;align-items:stretch}
.tm-feed-four{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tm-feed-story{min-width:0;border:1px solid #e3e7ed;border-radius:13px;overflow:hidden;background:#fff}
.tm-feed-image{width:100%;aspect-ratio:16/9;object-fit:cover;display:block;background:#f3f4f6}
.tm-feed-image-empty{background:linear-gradient(135deg,#f3f4f6,#e5e7eb)}
.tm-feed-story-body{padding:11px 12px 13px}
.tm-feed-story h3{margin:3px 0 0;font-size:17px;line-height:1.2;letter-spacing:-.01em}
.tm-feed-story h3 a{text-decoration:none}
.tm-feed-story p{margin:7px 0 0;color:#667085;font-size:13px;line-height:1.35}
.tm-feed-date{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#7a8494}
.tm-feed-story-main .tm-feed-story-body{padding:14px 15px 16px}
.tm-feed-story-main h3{font-size:24px}
.tm-feed-story-small h3{font-size:15px}
.tm-feed-story-small p{font-size:12px}
.tm-feed-story-side{display:grid;grid-template-columns:110px 1fr;gap:12px;align-items:start;padding:0;margin-bottom:12px}
.tm-feed-story-side .tm-feed-image{aspect-ratio:16/10}
.tm-feed-story-side .tm-feed-story-body{padding:10px 10px 10px 0}
.tm-feed-story-side h3{font-size:16px}
.tm-feed-waiting{border:1px dashed #cbd5e1;border-radius:12px;padding:18px;color:#667085;margin-bottom:12px;background:#fafbfc}
@media(max-width:900px){.tm-feed-layout{grid-template-columns:1fr}.tm-feed-four{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.tm-feed-four{grid-template-columns:1fr}.tm-feed-story-side{grid-template-columns:96px 1fr}}


/* Tony Stories: text-only presentation.
 * Featured images are intentionally not used here because their source
 * dimensions are inconsistent. Top Stories uses a controlled generic thumb.
 */
.tm-tony-text-grid .tm-tony-text-card .tm-card-body { padding:18px 18px 20px; }
.tm-tony-text-grid .tm-tony-text-card h3 { font-size:18px; line-height:1.2; }
.tm-tony-text-grid .tm-tony-text-card p { min-height:0; margin-top:9px; }

 .tm-tony-generic-thumb {
  width:110px;
  height:104px;
  flex:0 0 110px;
  border-radius:11px;
  overflow:hidden;
  background:#fff;
  border:1px solid #e1e5ea;
  box-sizing:border-box;
}
.tm-tony-generic-thumb img {
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
@media(max-width:620px){
  .tm-tony-generic-thumb { width:96px; flex-basis:96px; }
}
