/*
Theme Name: Coruja Editorial
Theme URI: https://coruja.in
Author: Codex
Description: India-first editorial theme for AI, SEO, SMM and technology coverage.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: coruja
Tags: news, blog, custom-logo, custom-menu, featured-images
*/

:root {
    --bg: #f7f4ea;
    --surface: #fffdf7;
    --surface-strong: #10201d;
    --ink: #111827;
    --muted: #526070;
    --line: #ded8c7;
    --accent: #009b7d;
    --accent-dark: #04705d;
    --saffron: #f59e0b;
    --indigo: #4338ca;
    --blue: #0f6fff;
    --shadow: 0 18px 44px rgba(17, 24, 39, .10);
    --radius: 8px;
    --container: 1220px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-dark); }

.coruja-container {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 244, 234, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}
.header-inner {
    min-height: 84px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}
.brand {
    display: grid;
    grid-template-columns: minmax(150px, 218px);
    gap: 4px;
    align-items: center;
    justify-items: start;
    max-width: 230px;
}
.brand-logo-wrap { display: block; }
.brand-logo {
    width: min(218px, 44vw);
    max-height: 70px;
    height: auto;
    object-fit: contain;
}
.brand-fallback {
    display: grid;
    grid-template-columns: 44px auto;
    gap: 10px;
    align-items: center;
}
.brand-mark {
    width: 44px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent-dark);
    font-weight: 1000;
    box-shadow: 6px 6px 0 rgba(245, 158, 11, .24);
}
.brand-title { font-size: 27px; font-weight: 1000; line-height: 1; }
.brand-title span { color: var(--accent-dark); }
.brand-copy { display: block; }
.brand-tagline {
    margin-top: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}
.site-footer .brand-logo {
    width: min(190px, 52vw);
    max-height: 62px;
}

.primary-menu, .footer-menu {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}
.primary-menu a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 11px;
    border-radius: var(--radius);
    color: #273241;
    font-size: 14px;
    font-weight: 850;
}
.primary-menu .current-menu-item > a,
.primary-menu a:hover {
    background: #e9f8f2;
    color: var(--accent-dark);
}
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.icon-button,
.pill-button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--ink);
}
.icon-button { width: 42px; padding: 0; font-size: 20px; }
.pill-button { background: var(--ink); color: #fff; border-color: var(--ink); }

.coruja-ad {
    padding: 18px 0 0;
}
.coruja-ad .coruja-container {
    display: grid;
    gap: 8px;
}
.coruja-ad-label {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.coruja-ad-link {
    display: block;
    width: min(100%, 980px);
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #071527;
    box-shadow: var(--shadow);
}
.coruja-ad-link img {
    display: block;
    width: 100%;
    height: auto;
    background: #071527;
}

.hero {
    padding: clamp(36px, 7vw, 80px) 0 28px;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 24px;
    align-items: stretch;
}
.hero-main,
.hero-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.hero-main { padding: clamp(24px, 5vw, 46px); }
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: var(--accent-dark);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 1000;
    text-transform: uppercase;
}
.kicker::before {
    content: "";
    width: 10px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--indigo), var(--accent), var(--saffron));
}
h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: 0;
}
h1 { font-size: clamp(44px, 7vw, 82px); max-width: 820px; }
.hero-copy {
    max-width: 760px;
    margin: 20px 0 0;
    color: #344155;
    font-size: clamp(18px, 2vw, 22px);
}
.hero-search {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    max-width: 780px;
}
.hero-search input,
.search-page-form input {
    width: 100%;
    min-height: 52px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 0 16px;
    font: inherit;
}
.hero-search button,
.search-page-form button,
.cta {
    min-height: 52px;
    border: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    padding: 0 18px;
    font-weight: 1000;
    cursor: pointer;
}
.hero-chips {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.hero-chips a,
.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #273241;
    font-size: 13px;
    font-weight: 850;
}

.hero-panel {
    padding: 24px;
    background: #10201d;
    color: #fff;
}
.hero-panel .kicker { color: #8ff5dc; }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}
.metric {
    border: 1px solid rgba(255,255,255,.16);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(255,255,255,.06);
}
.metric strong { display: block; font-size: 30px; line-height: 1; }
.metric span { color: #cde4df; font-size: 12px; }
.standard-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.standard-list li {
    border: 1px solid rgba(255,255,255,.14);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: rgba(255,255,255,.06);
}

.section {
    padding: 34px 0;
}
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 18px;
}
.section-head h2 { font-size: clamp(26px, 4vw, 42px); }
.section-head p {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 720px;
}
.section-head a { color: var(--accent-dark); font-weight: 1000; }

.front-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 22px;
}
.latest-stack { display: grid; gap: 12px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.article-card {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(17,24,39,.06);
}
.article-card.compact {
    grid-template-columns: 142px 1fr;
    min-height: 150px;
}
.article-media {
    aspect-ratio: 16 / 9;
    background: #0f172a;
    overflow: hidden;
}
.article-card.compact .article-media { aspect-ratio: auto; min-height: 100%; }
.article-media img { width: 100%; height: 100%; object-fit: cover; }
.media-fallback {
    width: 100%;
    height: 100%;
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(0,155,125,.16), transparent 45%),
        linear-gradient(12deg, #0f172a 0 42%, #1f3a32 43% 100%);
    color: #fff;
    font-family: var(--mono);
    font-weight: 1000;
    text-transform: uppercase;
    text-align: center;
}
.article-card.compact .media-fallback { min-height: 150px; }
.article-body { padding: 18px; display: grid; align-content: start; gap: 10px; }
.meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: #64748b;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}
.article-body h2,
.article-body h3 { font-size: clamp(21px, 2.5vw, 30px); }
.article-card.compact h3 { font-size: 18px; }
.article-body p { margin: 0; color: #3e4a5c; }
.read-more { color: var(--accent-dark); font-weight: 1000; }

.hub-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.hub-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 18px;
    min-height: 190px;
    display: grid;
    align-content: space-between;
    gap: 18px;
}
.hub-card h3 { font-size: 23px; }
.hub-card p { margin: 10px 0 0; color: var(--muted); }
.hub-card strong { color: var(--accent-dark); }

.cluster-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.cluster-card {
    min-height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 18px;
    box-shadow: 0 12px 28px rgba(17, 24, 39, .06);
}
.cluster-card h3 {
    font-size: 22px;
    margin-bottom: 13px;
}
.desk-links {
    display: grid;
    gap: 8px;
}
.desk-links a {
    min-height: 42px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 11px;
    border: 1px solid #d8eadf;
    border-radius: var(--radius);
    background: #f3fbf7;
    color: #1f2937;
    font-size: 14px;
    font-weight: 850;
}
.desk-links a:hover {
    border-color: var(--accent);
    background: #e9f8f2;
}
.desk-links strong {
    min-width: 28px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-strong);
    color: #fff;
    font-size: 12px;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) 320px;
    gap: 34px;
    align-items: start;
    padding: 34px 0 56px;
}
.article-shell,
.page-shell,
.archive-shell {
    padding: 34px 0 56px;
}
.article-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 22px;
    margin-bottom: 24px;
}
.article-header h1 { font-size: clamp(38px, 6vw, 70px); }
.article-featured {
    margin: 0 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}
.content {
    font-size: 18px;
    color: #1f2937;
}
.content a { color: var(--accent-dark); font-weight: 800; }
.content p { margin: 0 0 20px; }
.content h2 { margin: 34px 0 14px; font-size: 32px; }
.content h3 { margin: 26px 0 12px; font-size: 24px; }
.content ul, .content ol { padding-left: 24px; }
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #fff;
}
.content th, .content td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
.content th { background: #f1f5f0; }

.sidebar-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 18px;
    position: sticky;
    top: 108px;
}
.sidebar-card h3 { font-size: 21px; }
.sidebar-card p { color: var(--muted); margin: 10px 0 0; }
.sidebar-card ul { margin: 14px 0 0; padding-left: 18px; }

.site-footer {
    border-top: 1px solid var(--line);
    background: #10201d;
    color: #f8fafc;
    padding: 34px 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
}
.footer-menu { justify-content: flex-end; }
.footer-menu a {
    color: #dce7e4;
    font-weight: 800;
    font-size: 14px;
}
.footer-note {
    color: #b9cbc6;
    max-width: 620px;
}

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

@media (max-width: 980px) {
    .header-inner { grid-template-columns: 1fr; padding: 14px 0; }
    .primary-menu { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .header-actions { display: none; }
    .hero-grid, .front-grid, .article-layout, .footer-grid { grid-template-columns: 1fr; }
    .card-grid, .card-grid.two, .hub-grid, .cluster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar-card { position: static; }
}

@media (max-width: 640px) {
    .coruja-container { width: min(100% - 24px, var(--container)); }
    .hero-search { grid-template-columns: 1fr; }
    .card-grid, .card-grid.two, .hub-grid, .cluster-grid { grid-template-columns: 1fr; }
    .article-card.compact { grid-template-columns: 1fr; }
    .article-card.compact .article-media { aspect-ratio: 16 / 9; }
    h1 { font-size: 42px; }
    .hero-main, .hero-panel { padding: 20px; }
}
