/*
Theme Name: WP Theme Dev - a03 (Home Widgets – Apple Light)
Author: Kayden Konshak
Description: Minimal Apple-style UI for WPTD Assignment 03 — Home Widgets, cards, and sidebars.
Version: 1.0
Text Domain: wptd-a03
License: GPLv3
*/

/* =========================
   Design Tokens — Apple Light
   ========================= */
:root {
  /* Palette */
  --bg: #ffffff;
  --surface: #ffffff;
  --elev: #fbfbfd;               /* subtle elevated bg */
  --text: #111113;               /* near-black */
  --muted: #6b7280;              /* gray-500 */
  --line: rgba(0, 0, 0, .08);    /* hairline */
  --ring: rgba(10, 132, 255, .35); /* focus ring */
  --blue: #0A84FF;               /* Apple blue */
  --blue-ink: #0071e3;           /* link focus/hover */
  --danger: #d92d20;

  /* Rounding & shadow */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-2: 0 8px 30px rgba(0, 0, 0, .06);

  /* Type & sizing */
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --container: 1100px;
  --gap: 2.2rem;
}

/* =========================
   Base / Reset
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
  border-radius: 0;
}

a {
  color: var(--blue-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: #fff;
  color: #000;
  padding: .5rem .75rem;
  border-radius: .5rem;
  z-index: 10000;
  box-shadow: var(--shadow-1);
}

/* =========================
   Wrapper
   ========================= */
.wrapper {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* =========================
   Header — translucent, crisp
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255, 255, 255, .75);
  border-bottom: 1px solid var(--line);
}

.header__top.container,
.header__bottom.container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: .85rem;
}

/* Branding */
.branding {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.branding__text {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text);
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
}

.site-description {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

/* Main/Sub nav */
.nav {
  width: 100%;
}

.nav .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: .25rem .5rem;
  flex-wrap: wrap;
}

.nav .menu a {
  display: inline-block;
  padding: .42rem .7rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav--main .menu a:hover {
  background: #f2f2f7;
  border-color: var(--line);
}

.nav--sub .menu a {
  color: #374151;
}

.nav--sub .menu a:hover {
  background: #f2f2f7;
  color: #111113;
}

/* Drawer toggle (mobile) — instructor markup */
#nav-toggle-icon {
  position: absolute;
  left: -9999px;
}

.nav-toggle__label,
label[for="nav-toggle-icon"] {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
}

label[for="nav-toggle-icon"] span,
label[for="nav-toggle-icon"] span::before,
label[for="nav-toggle-icon"] span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #111;
  content: "";
  position: relative;
  transition: .2s ease;
}

label[for="nav-toggle-icon"] span::before {
  position: absolute;
  top: -6px;
}

label[for="nav-toggle-icon"] span::after {
  position: absolute;
  top: 6px;
}

.nav-main-drawer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

@media (max-width: 900px) {
  label[for="nav-toggle-icon"] {
    display: flex;
  }

  .nav-main-drawer {
    position: fixed;
    inset: 60px 0 auto 0;
    background: #ffffff;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--line);
    transform: translateY(-120%);
    transition: .25s ease;
    flex-direction: column;
    align-items: stretch;
    z-index: 999;
    box-shadow: var(--shadow-2);
  }

  #nav-toggle-icon:checked ~ label[for="nav-toggle-icon"] span {
    background: transparent;
  }

  #nav-toggle-icon:checked ~ label[for="nav-toggle-icon"] span::before {
    top: 0;
    transform: rotate(45deg);
  }

  #nav-toggle-icon:checked ~ label[for="nav-toggle-icon"] span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  #nav-toggle-icon:checked ~ .nav-main-drawer {
    transform: translateY(0);
  }

  .nav .menu {
    flex-direction: column;
    gap: .25rem;
  }
}

/* Search in header */
.search-form input[type="search"] {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: 10px;
  width: min(260px, 60vw);
}

.search-form input[type="submit"] {
  margin-left: .5rem;
  padding: .5rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #111;
  cursor: pointer;
}

.search-form input[type="submit"]:hover {
  border-color: #d0d5dd;
}

/* =========================
   Layout
   ========================= */
.layout {
  display: grid;
  gap: var(--gap);
  align-items: start;
}

.layout--with-sidebar {
  grid-template-columns: 1fr 300px;
}

@media (max-width: 1024px) {
  .layout--with-sidebar {
    grid-template-columns: 1fr;
  }
}

.content-area {
  display: grid;
  gap: calc(var(--gap) * .9);
  padding-block: 2.2rem;
}

.site-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 86px;
  align-self: start;
}

/* Archive header (if used) */
.archive-header {
  display: grid;
  gap: .35rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}

.page-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: #111113;
}

.archive-description {
  color: var(--muted);
}

/* =========================
   Cards (index/archive)
   ========================= */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: none;
}

.card-figure {
  border-bottom: 1px solid var(--line);
}

.card-figure img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-section {
  padding: 1.05rem 1.2rem 1.1rem;
  display: grid;
  gap: .55rem;
  align-content: start;
}

.card-section-title {
  margin: .1rem 0 .2rem;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: .005em;
}

.card-section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: center;
  font-size: .92rem;
  color: var(--muted);
}

.card-section-meta-date {
  white-space: nowrap;
}

.card-section-meta-author,
.card-section-meta-comments {
  white-space: nowrap;
}

.card-section-excerpt {
  color: var(--text);
}

.card-section-button {
  align-self: flex-start;
  margin-top: .2rem;
  display: inline-block;
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: .9rem;
}

.card-section-button:hover {
  background: #f7f7fa;
}

/* Hover lift */
.cards .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

/* =========================
   Entries (single/page)
   ========================= */
.entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
  padding: 1.45rem;
}

.entry__title {
  margin: .25rem 0 .6rem;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.01em;
}

.entry__meta {
  color: var(--muted);
  font-size: .98rem;
}

.entry__media img {
  border-radius: 12px;
  margin-bottom: 1rem;
}

.entry__content {
  line-height: 1.72;
}

.entry__content p {
  margin-bottom: 1rem;
}

.entry__footer {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: .85rem;
}

.tags {
  margin: 0;
}

.page-links {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* =========================
   Sidebar & Widgets
   ========================= */
.sidebar-widgets .widget,
.site-sidebar .widget {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-1);
}

.widget-title,
.widget__title {
  margin: 0 0 .6rem;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Header widget area */
.header-widgets {
  padding-block: .4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Upper footer widget area */
.footer-upper-widgets .widget {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow-1);
}

.footer-upper-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 900px) {
  .footer-upper-widgets {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Post Navigation
   ========================= */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.post-nav__prev a,
.post-nav__next a {
  display: inline-block;
  padding: .5rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

/* =========================
   Pagination
   ========================= */
.pagination {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

.pagination .nav-links {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: .45rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.pagination .current {
  background: #f2f2f7;
}

/* =========================
   Footer (airy, split)
   ========================= */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer-main.container {
  padding-block: 1.25rem;
}

.footer-upper {
  margin-bottom: 1rem;
}

.footer-lower {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.nav--footer .menu {
  gap: .35rem;
}

.nav--footer .menu a {
  color: #374151;
}

.nav--footer .menu a:hover {
  background: #f2f2f7;
  border-radius: 999px;
}

.menu--footer-utilities {
  list-style: none;
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: 0;
}

.menu--footer-utilities a {
  color: #374151;
}

.menu--footer-utilities a:hover {
  color: #111113;
}

.site-info {
  color: #6b7280;
  font-size: .92rem;
  margin-top: .75rem;
}

@media (max-width: 900px) {
  .footer-lower {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
}

/* =========================
   Buttons, Forms, Tables
   ========================= */
.button,
.button--text,
.wp-block-button__link {
  display: inline-block;
  padding: .55rem .85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: #111113;
  text-decoration: none;
  background: #fff;
}

.button:hover,
.wp-block-button__link:hover {
  background: #f7f7fa;
}

.button--text {
  border-color: transparent;
  background: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th,
td {
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--line);
}

thead th {
  text-align: left;
  color: #6b7280;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: #fff;
  color: #111113;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .6rem .8rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.wp-block-code,
pre {
  background: #fbfbfd;
  color: #0f172a;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  font-family: var(--font-mono);
  overflow: auto;
}

/* Figures & captions */
figure {
  margin: 0;
}

figcaption {
  color: #6b7280;
  font-size: .9rem;
}

/* =========================
   Accessibility / screen reader
   ========================= */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #eee;
  clip: auto !important;
  clip-path: none;
  color: #444;
  display: block;
  font-size: 1em;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* =========================
   Gutenberg niceties
   ========================= */
.wp-block-image figcaption {
  color: #6b7280;
  font-size: .9rem;
}

.wp-block-quote {
  border-left: 3px solid #e5e7eb;
  padding-left: 1rem;
  color: #4b5563;
}

.wp-block-separator {
  border: none;
  border-top: 1px solid var(--line);
  margin-block: 1.5rem;
}

/* =========================
   Tag Cloud Styling — Assignment 03
   ========================= */

.wp-block-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.wp-block-tag-cloud .tag-cloud-link {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  background-color: oklch(0.95 0.02 250);
  color: oklch(0.35 0.07 250);
  border: 1px solid oklch(0.85 0.05 250);
  font-size: 14px !important; /* override inline size, not using em */
  line-height: 1.4;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wp-block-tag-cloud .tag-cloud-link:hover,
.wp-block-tag-cloud .tag-cloud-link:focus-visible {
  background-color: oklch(0.88 0.08 250);
  color: oklch(0.18 0.10 250);
  transform: translateY(-1px);
}
