/*
Theme Name: Atlas
Theme URI: https://example.com/atlas
Author: Your Name
Author URI: https://example.com
Description: A lightweight, Elementor-ready starter theme. Coded header and footer for your branding, quiet content styling so Elementor controls your pages, and every color, font, and spacing value exposed as a CSS variable for one-file rebranding. Works with free Elementor; Theme Builder locations are registered so Elementor Pro can override the header and footer if you have it.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: atlas
Tags: elementor, custom-menu, featured-images, threaded-comments, translation-ready, full-width-template
*/

/* ==========================================================================
   1. Design tokens  —  rebrand the whole theme by editing values here
   ========================================================================== */
:root {
  /* Colors */
  --atlas-bg:          #ffffff;
  --atlas-surface:     #f7f5f1;   /* footer / muted panels */
  --atlas-ink:         #1b1a17;   /* body text            */
  --atlas-heading:     #14130f;   /* headings             */
  --atlas-muted:       #6b665e;   /* meta, captions       */
  --atlas-accent:      #0e7c6b;   /* links, buttons       */
  --atlas-accent-ink:  #0a5c4f;   /* accent hover         */
  --atlas-line:        #e6e2da;   /* hairlines, borders   */
  --atlas-focus:       #0e7c6b;   /* keyboard focus ring  */

  /* Typography */
  --atlas-font-body:    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --atlas-font-heading: ui-serif, Georgia, "Times New Roman", serif;
  --atlas-fs-base:      1.05rem;
  --atlas-lh-base:      1.7;
  --atlas-fw-heading:   600;

  /* Layout */
  --atlas-content-width: 1140px;
  --atlas-gutter:        clamp(1rem, 4vw, 2rem);
  --atlas-radius:        8px;

  /* Spacing scale */
  --atlas-space-xs: 0.5rem;
  --atlas-space-sm: 1rem;
  --atlas-space-md: 1.75rem;
  --atlas-space-lg: 3rem;
  --atlas-space-xl: 5rem;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--atlas-bg);
  color: var(--atlas-ink);
  font-family: var(--atlas-font-body);
  font-size: var(--atlas-fs-base);
  line-height: var(--atlas-lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--atlas-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--atlas-accent-ink); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--atlas-font-heading);
  font-weight: var(--atlas-fw-heading);
  line-height: 1.2;
  color: var(--atlas-heading);
  margin: 0 0 var(--atlas-space-sm);
}

p, ul, ol, blockquote, figure, table { margin: 0 0 var(--atlas-space-md); }

blockquote {
  margin-inline: 0;
  padding-left: var(--atlas-space-md);
  border-left: 3px solid var(--atlas-accent);
  color: var(--atlas-muted);
  font-style: italic;
}

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--atlas-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.atlas-container {
  width: 100%;
  max-width: var(--atlas-content-width);
  margin-inline: auto;
  padding-inline: var(--atlas-gutter);
}

.atlas-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--atlas-ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 var(--atlas-radius) 0;
}
.atlas-skip-link:focus { left: 0; color: #fff; }

/* Content column (used when a page is NOT built full-width in Elementor) */
.atlas-main { padding-block: var(--atlas-space-xl); }
.atlas-content-narrow { max-width: 760px; margin-inline: auto; }

/* ==========================================================================
   4. Site header
   ========================================================================== */
.atlas-header {
  border-bottom: 1px solid var(--atlas-line);
  background: var(--atlas-bg);
}
.atlas-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--atlas-space-md);
  min-height: 72px;
}
.atlas-branding { display: flex; align-items: center; gap: 0.75rem; }
.atlas-branding a { text-decoration: none; color: var(--atlas-heading); }
.atlas-site-title {
  font-family: var(--atlas-font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.atlas-site-desc { margin: 0; font-size: 0.85rem; color: var(--atlas-muted); }
.custom-logo { max-height: 48px; width: auto; }

/* Primary navigation */
.atlas-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--atlas-space-md); }
.atlas-nav li { position: relative; }
.atlas-nav a {
  display: inline-block;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--atlas-ink);
  font-size: 0.98rem;
}
.atlas-nav a:hover,
.atlas-nav .current-menu-item > a { color: var(--atlas-accent); }

/* Sub-menus */
.atlas-nav ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  flex-direction: column;
  gap: 0;
  min-width: 200px;
  background: var(--atlas-bg);
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius);
  padding: 0.5rem 0;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 50;
}
.atlas-nav li:hover > ul,
.atlas-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.atlas-nav ul ul a { padding: 0.5rem 1rem; }

/* Mobile menu toggle */
.atlas-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius);
  padding: 0.5rem 0.85rem;
  font: inherit;
  color: var(--atlas-ink);
  cursor: pointer;
}
.atlas-menu-toggle__bars { width: 18px; height: 2px; background: currentColor; position: relative; }
.atlas-menu-toggle__bars::before,
.atlas-menu-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.atlas-menu-toggle__bars::before { top: -6px; }
.atlas-menu-toggle__bars::after  { top: 6px; }

@media (max-width: 860px) {
  .atlas-menu-toggle { display: inline-flex; }
  .atlas-nav {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--atlas-bg);
    border-bottom: 1px solid var(--atlas-line);
    padding: var(--atlas-space-sm) var(--atlas-gutter);
    display: none;
  }
  .atlas-header__inner { position: relative; }
  .atlas-nav.is-open { display: block; }
  .atlas-nav ul { flex-direction: column; gap: 0; }
  .atlas-nav > ul > li { border-bottom: 1px solid var(--atlas-line); }
  .atlas-nav ul ul {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding-left: 1rem;
  }
}

/* ==========================================================================
   5. Posts & articles
   ========================================================================== */
.atlas-entry { margin-bottom: var(--atlas-space-xl); }
.atlas-entry__title { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.atlas-entry__title a { text-decoration: none; color: inherit; }
.atlas-entry__title a:hover { color: var(--atlas-accent); }
.atlas-entry__meta {
  color: var(--atlas-muted);
  font-size: 0.9rem;
  margin-bottom: var(--atlas-space-md);
}
.atlas-entry__meta a { color: var(--atlas-muted); }
.atlas-entry__thumb { margin-bottom: var(--atlas-space-md); border-radius: var(--atlas-radius); overflow: hidden; }
.atlas-readmore {
  display: inline-block;
  margin-top: var(--atlas-space-xs);
  font-weight: 600;
  text-decoration: none;
}
.atlas-readmore::after { content: " \2192"; }

/* Pagination */
.atlas-pagination { margin-top: var(--atlas-space-lg); }
.atlas-pagination .page-numbers {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  margin-right: 0.25rem;
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius);
  text-decoration: none;
}
.atlas-pagination .current {
  background: var(--atlas-accent);
  border-color: var(--atlas-accent);
  color: #fff;
}

/* ==========================================================================
   6. Sidebar & widgets
   ========================================================================== */
.atlas-layout { display: grid; gap: var(--atlas-space-lg); }
@media (min-width: 992px) {
  .atlas-layout.has-sidebar { grid-template-columns: minmax(0,1fr) 320px; }
}
.atlas-widget { margin-bottom: var(--atlas-space-lg); }
.atlas-widget .widget-title {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--atlas-accent);
  margin-bottom: var(--atlas-space-sm);
}
.atlas-widget ul { list-style: none; padding: 0; margin: 0; }
.atlas-widget li { padding: 0.4rem 0; border-bottom: 1px solid var(--atlas-line); }

/* ==========================================================================
   7. Site footer
   ========================================================================== */
.atlas-footer {
  background: var(--atlas-surface);
  border-top: 1px solid var(--atlas-line);
  margin-top: var(--atlas-space-xl);
  padding-block: var(--atlas-space-xl) var(--atlas-space-lg);
}
.atlas-footer__widgets {
  display: grid;
  gap: var(--atlas-space-lg);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: var(--atlas-space-lg);
}
.atlas-footer .widget-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--atlas-space-sm);
}
.atlas-footer ul { list-style: none; padding: 0; margin: 0; }
.atlas-footer li { padding: 0.3rem 0; }
.atlas-footer__bar {
  border-top: 1px solid var(--atlas-line);
  padding-top: var(--atlas-space-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--atlas-space-sm);
  color: var(--atlas-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   8. Buttons (used by comments / fallback forms)
   ========================================================================== */
.atlas-btn,
input[type="submit"], button.submit {
  display: inline-block;
  background: var(--atlas-accent);
  color: #fff;
  border: 0;
  border-radius: var(--atlas-radius);
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.atlas-btn:hover,
input[type="submit"]:hover { background: var(--atlas-accent-ink); color: #fff; }

/* ==========================================================================
   9. WordPress core alignment & caption classes
   ========================================================================== */
.alignleft  { float: left;  margin: 0 var(--atlas-space-md) var(--atlas-space-sm) 0; }
.alignright { float: right; margin: 0 0 var(--atlas-space-sm) var(--atlas-space-md); }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .gallery-caption { color: var(--atlas-muted); font-size: 0.85rem; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; overflow: hidden; position: absolute !important;
  word-wrap: normal !important;
}

/* ==========================================================================
   10. Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
