/*
Theme Name: Sepidroud Net
Theme URI: https://sepidroudnet.ir/
Author: Sepidroud Net
Author URI: https://sepidroudnet.ir/
Description: Apple-style Persian theme for Sepidroud Net — Internet, Computer & Network Services in Rudbar.
Version: 1.0.4
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sepidroud
*/

/* -------------------------------------------------------------
   APPLE LIGHT DESIGN SYSTEM
-------------------------------------------------------------- */
:root {
  --apple-white: #ffffff;
  --apple-bg-subtle: #f5f5f7;
  --apple-card-bg: #ffffff;
  --apple-text-primary: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-text-muted: #86868b;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-soft: #f0f7ff;
  --apple-border: rgba(0, 0, 0, 0.08);
  --apple-border-subtle: rgba(0, 0, 0, 0.04);
  --apple-nav-blur: saturate(180%) blur(20px);
  --apple-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --apple-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
  --apple-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  --ease-apple: cubic-bezier(0.28, 0.11, 0.32, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background-color: var(--apple-white);
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", sans-serif;
  background-color: var(--apple-white);
  color: var(--apple-text-primary);
  line-height: 1.6;
  font-size: 15px;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.25s var(--ease-apple);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------------------------------------------------
   APPLE GLOBAL NAVIGATION (FROSTED WHITE GLASS)
-------------------------------------------------------------- */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 999;
  height: 48px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: var(--apple-nav-blur);
  -webkit-backdrop-filter: var(--apple-nav-blur);
  border-bottom: 1px solid var(--apple-border);
  display: flex;
  align-items: center;
}
.global-nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--apple-text-primary);
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 12.5px;
  color: var(--apple-text-secondary);
  font-weight: 400;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--apple-text-primary); }

/* Nav action group (LinkedIn + Gallery + Portal) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Apple Rounded Pill Buttons */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.25s var(--ease-apple);
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.pill-btn-blue {
  background: var(--apple-blue);
  color: #ffffff;
}
.pill-btn-blue:hover {
  background: var(--apple-blue-hover);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.25);
  transform: scale(1.02);
  color: #ffffff;
}
.pill-btn-ghost {
  background: rgba(0, 0, 0, 0.04);
  color: var(--apple-text-primary);
  border: 1px solid var(--apple-border);
}
.pill-btn-ghost:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.16);
}

/* LinkedIn pill — same geometry, brand-blue accent */
.pill-btn-linkedin {
  background: rgba(10, 102, 194, 0.08);
  color: #0a66c2;
  border: 1px solid rgba(10, 102, 194, 0.15);
}
.pill-btn-linkedin:hover {
  background: #0a66c2;
  color: #ffffff;
  border-color: #0a66c2;
  box-shadow: 0 4px 16px rgba(10, 102, 194, 0.25);
  transform: scale(1.02);
}
.pill-btn-linkedin svg { flex-shrink: 0; }

/* -------------------------------------------------------------
   APPLE LOCAL SUB-NAVIGATION (PINNED STICKY)
-------------------------------------------------------------- */
.local-nav {
  position: sticky;
  top: 48px;
  z-index: 998;
  height: 52px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: var(--apple-nav-blur);
  -webkit-backdrop-filter: var(--apple-nav-blur);
  border-bottom: 1px solid var(--apple-border);
  display: flex;
  align-items: center;
}
.local-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.local-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--apple-text-primary);
  letter-spacing: -0.015em;
}
.local-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}
.local-menu a {
  font-size: 12px;
  color: var(--apple-text-secondary);
}
.local-menu a:hover, .local-menu a.active {
  color: var(--apple-blue);
  font-weight: 600;
}

/* -------------------------------------------------------------
   APPLE LIGHT HERO SECTION
-------------------------------------------------------------- */
.hero-apple {
  position: relative;
  padding: 105px 0 95px;
  text-align: center;
  background: radial-gradient(60% 60% at 50% 15%, #f2f7ff 0%, #ffffff 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--apple-border-subtle);
}
.hero-eyebrow {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--apple-blue);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  display: inline-block;
  text-transform: uppercase;
}
.hero-headline {
  font-size: 54px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  max-width: 860px;
  margin: 0 auto 20px;
  color: var(--apple-text-primary);
}
.hero-subhead {
  font-size: 20px;
  font-weight: 400;
  color: var(--apple-text-secondary);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.65;
}
.hero-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.hero-cta .pill-btn { padding: 12px 26px; font-size: 14px; }
.hero-badge-strip {
  margin-top: 50px;
  font-size: 12.5px;
  color: var(--apple-text-muted);
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------------
   APPLE BENTO GRID
-------------------------------------------------------------- */
.section-bento {
  padding: 100px 0 70px;
  background-color: var(--apple-bg-subtle);
}
.section-header-apple { text-align: center; margin-bottom: 55px; }
.apple-label {
  font-size: 13px;
  color: var(--apple-blue);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.apple-heading {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--apple-text-primary);
}
.bento-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}
.bento-card {
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 28px;
  padding: 44px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 360px;
  box-shadow: var(--apple-shadow-card);
  transition: transform 0.4s var(--ease-apple), box-shadow 0.4s ease, border-color 0.4s ease;
}
.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--apple-shadow-hover);
  border-color: rgba(0, 113, 227, 0.25);
}
.bento-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--apple-blue);
  margin-bottom: 12px;
}
.bento-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--apple-text-primary);
  line-height: 1.3;
  margin-bottom: 14px;
}
.bento-desc {
  font-size: 15px;
  color: var(--apple-text-secondary);
  line-height: 1.75;
  max-width: 480px;
  font-weight: 300;
}
.bento-bottom {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bento-row-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

/* -------------------------------------------------------------
   ARTICLE / BLOG SECTION (STICKY TOC)
-------------------------------------------------------------- */
.section-article {
  background-color: var(--apple-white);
  color: var(--apple-text-primary);
  padding: 100px 0;
  border-top: 1px solid var(--apple-border);
}
.article-apple-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 44px;
  align-items: start;
  margin-top: 50px;
}
.toc-apple-nav {
  position: sticky;
  top: 115px;
  background: var(--apple-bg-subtle);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--apple-shadow-sm);
}
.toc-apple-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--apple-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.toc-apple-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc-apple-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--apple-text-secondary);
  padding: 8px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
}
.toc-apple-link::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c7c7cc;
  transition: all 0.2s ease;
}
.toc-apple-link:hover, .toc-apple-link.active {
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.08);
  font-weight: 600;
}
.toc-apple-link.active::before {
  background: var(--apple-blue);
  transform: scale(1.6);
}
.article-apple-card {
  background: var(--apple-white);
  border: 1px solid var(--apple-border);
  border-radius: 28px;
  padding: 50px 56px;
  box-shadow: var(--apple-shadow-card);
}
.article-pill-tag {
  font-size: 12px;
  color: var(--apple-blue);
  font-weight: 600;
  margin-bottom: 12px;
  display: inline-block;
}
.article-apple-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--apple-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 16px;
}
.article-author-date {
  font-size: 13px;
  color: var(--apple-text-muted);
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--apple-border);
}
.article-text-body h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--apple-text-primary);
  margin: 34px 0 14px;
  letter-spacing: -0.01em;
  scroll-margin-top: 130px;
}
.article-text-body p {
  font-size: 15.5px;
  color: #3a3a3c;
  line-height: 1.85;
  margin-bottom: 20px;
}
.apple-quote-box {
  margin: 28px 0;
  padding: 22px 24px;
  background: var(--apple-bg-subtle);
  border-radius: 16px;
  border-right: 4px solid var(--apple-blue);
  font-size: 14.5px;
  color: var(--apple-text-primary);
  line-height: 1.75;
}
.recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.mini-post-card {
  background: var(--apple-bg-subtle);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 24px;
  transition: transform 0.3s var(--ease-apple), box-shadow 0.3s ease;
}
.mini-post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--apple-shadow-hover);
  background: var(--apple-white);
}
.mini-post-card span {
  font-size: 11px;
  color: var(--apple-text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.mini-post-card h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--apple-text-primary);
  line-height: 1.45;
}

/* -------------------------------------------------------------
   INFRASTRUCTURE SECTION
-------------------------------------------------------------- */
.section-gallery {
  padding: 100px 0;
  background: var(--apple-bg-subtle);
  border-top: 1px solid var(--apple-border);
}
.gallery-apple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.gallery-apple-item {
  background: var(--apple-white);
  border: 1px solid var(--apple-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--apple-shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-apple-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--apple-shadow-hover);
}
.gallery-apple-visual {
  height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f7f9fc 0%, #edf2f7 100%);
  color: var(--apple-blue);
}
.gallery-apple-meta { padding: 20px; }
.gallery-apple-meta h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--apple-text-primary);
  margin-bottom: 4px;
}
.gallery-apple-meta p {
  font-size: 12px;
  color: var(--apple-text-secondary);
}

/* -------------------------------------------------------------
   PHOTO GALLERY SECTION (Perfect Square Puzzle Layout)
-------------------------------------------------------------- */
.section-gallery-photos {
  padding: 100px 0;
  background-color: var(--apple-white);
  border-top: 1px solid var(--apple-border);
}

.gallery-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 16px;
  margin-top: 45px;
  aspect-ratio: 1 / 1; /* Forces the entire gallery area to be a perfect square */
}

.gallery-photo {
  display: block;
  border-radius: 22px;
  overflow: hidden;
  background: var(--apple-bg-subtle);
  box-shadow: var(--apple-shadow-sm);
  border: 1px solid var(--apple-border);
  transition: transform 0.3s var(--ease-apple), box-shadow 0.3s ease, border-color 0.3s ease;
}
.gallery-photo:hover {
  transform: scale(1.02); /* Slight scale prevents translate glitch on spanning items */
  box-shadow: var(--apple-shadow-hover);
  border-color: rgba(0, 113, 227, 0.25);
  z-index: 2;
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Crops images perfectly to fit the boxes */
  display: block;
}

/* The "Puzzle" Rules to make 10 images fill a perfect square */
.gallery-photo:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}
.gallery-photo:nth-child(2) {
  grid-column: span 2;
}
.gallery-photo:nth-child(9),
.gallery-photo:nth-child(10) {
  grid-column: span 2;
}

/* -------------------------------------------------------------
   ABOUT SECTION
-------------------------------------------------------------- */
.section-about {
  padding: 105px 0;
  background-color: var(--apple-white);
  border-top: 1px solid var(--apple-border);
}
.about-apple-box {
  background: var(--apple-bg-subtle);
  border: 1px solid var(--apple-border);
  border-radius: 32px;
  padding: 55px 65px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--apple-shadow-card);
}
.about-lead {
  font-size: 25px;
  font-weight: 700;
  color: var(--apple-text-primary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.about-body {
  font-size: 15.5px;
  color: var(--apple-text-secondary);
  line-height: 1.85;
  font-weight: 400;
}
.about-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 45px;
  padding-top: 35px;
  border-top: 1px solid var(--apple-border);
  text-align: center;
}
.metric-item h5 {
  font-size: 40px;
  font-weight: 800;
  color: var(--apple-blue);
  letter-spacing: -0.02em;
}
.metric-item p {
  font-size: 13px;
  color: var(--apple-text-secondary);
  margin-top: 4px;
}

/* -------------------------------------------------------------
   CONTACT SECTION
-------------------------------------------------------------- */
.section-contact {
  padding: 100px 0;
  background-color: var(--apple-bg-subtle);
  border-top: 1px solid var(--apple-border);
}
.contact-apple-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 45px;
}
.contact-apple-card {
  background: var(--apple-white);
  border: 1px solid var(--apple-border);
  border-radius: 26px;
  padding: 38px;
  box-shadow: var(--apple-shadow-card);
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
}
.contact-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--apple-blue-soft);
  color: var(--apple-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-item h5 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--apple-text-primary);
  margin-bottom: 4px;
}
.contact-item p {
  font-size: 13.5px;
  color: var(--apple-text-secondary);
  line-height: 1.7;
}
.apple-input-group { margin-bottom: 18px; }
.apple-input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-text-secondary);
  margin-bottom: 6px;
}
.apple-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--apple-bg-subtle);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  color: var(--apple-text-primary);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.apple-input:focus {
  border-color: var(--apple-blue);
  background-color: var(--apple-white);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* -------------------------------------------------------------
   FOOTER
-------------------------------------------------------------- */
.apple-footer {
  background-color: #f5f5f7;
  color: #86868b;
  font-size: 11.5px;
  padding: 40px 0 50px;
  border-top: 1px solid var(--apple-border);
  line-height: 1.8;
}
.footer-disclaimers {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--apple-border);
}
.footer-legal-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-nav-crumbs {
  display: flex;
  gap: 16px;
  list-style: none;
}
.footer-nav-crumbs a { color: #6e6e73; }
.footer-nav-crumbs a:hover { color: var(--apple-blue); }

/* -------------------------------------------------------------
   SCROLL ANIMATIONS
-------------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-apple), transform 0.7s var(--ease-apple);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN
-------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-headline { font-size: 36px; }
  .bento-grid, .bento-row-bottom, .article-apple-container, .contact-apple-grid, .recent-posts-grid {
    grid-template-columns: 1fr;
  }
  .toc-apple-nav { position: static; margin-bottom: 24px; }
  .nav-links { display: none; }
  .about-apple-box { padding: 40px 24px; }
  .about-metrics { grid-template-columns: 1fr; gap: 20px; }
  .nav-actions .pill-btn-linkedin span,
  .nav-actions .pill-btn-gallery span { display: none; }
  .nav-actions .pill-btn-linkedin,
  .nav-actions .pill-btn-gallery { padding: 8px; }
  
  /* Reset the puzzle layout for mobile/tablet */
  .gallery-photos {
    grid-template-columns: repeat(2, 1fr);
    aspect-ratio: auto; /* Removes the forced square shape */
    grid-auto-rows: auto;
    gap: 12px;
  }
  .gallery-photo {
    aspect-ratio: 4 / 3; /* Restores standard image shape */
    border-radius: 18px;
  }
  /* Only the first image spans full width on mobile */
  .gallery-photo:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 16 / 9;
  }
  /* Reset all other spanning */
  .gallery-photo:nth-child(2),
  .gallery-photo:nth-child(9),
  .gallery-photo:nth-child(10) {
    grid-column: span 1;
  }
}

@media (max-width: 500px) {
  .gallery-photos { 
    grid-template-columns: 1fr; 
  }
  .gallery-photo:nth-child(1) {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }
}